码迷,mamicode.com
首页 >  
搜索关键字:determine    ( 2744个结果
Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:其他好文   时间:2014-07-13 16:53:01    阅读次数:189
Linked List Cycle
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? /** * Definition for singly-linked list. * class ListNode { * int val; * ...
分类:其他好文   时间:2014-07-13 16:32:04    阅读次数:152
Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all va...
分类:其他好文   时间:2014-07-13 16:11:26    阅读次数:144
Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree and sum ...
分类:其他好文   时间:2014-07-13 13:58:01    阅读次数:184
LeetCode——Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a ...
分类:其他好文   时间:2014-07-12 20:10:54    阅读次数:165
LeetCode :: Validate Binary Search Tree[详细分析]
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:其他好文   时间:2014-07-12 17:26:31    阅读次数:256
LeetCode——Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = "leetcode", dict = ["leet"...
分类:其他好文   时间:2014-07-10 20:57:26    阅读次数:215
IP地址分类
An IP address is 32-bit long. IP addresses are classified into A, B, C, D, and E classes, as shown in the figure below. Please determine the class of an input IP address and obtain the corresponding IP address information according to the input 32-bit IP ...
分类:其他好文   时间:2014-07-09 12:43:54    阅读次数:232
【LeetCode】Path Sum
题目 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree ...
分类:其他好文   时间:2014-07-09 10:32:42    阅读次数:151
【LeetCode】Linked List Cycle
题目 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 解答 首先要注意空链表不成环;不能开额外的空间,即空间复杂度是o(1),可采用“快慢指针”查检查链表是否含有环,如果在快的指针能够追上慢的指针,则有环,否...
分类:其他好文   时间:2014-07-08 19:17:47    阅读次数:160
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!