Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2014-06-19 11:23:05
阅读次数:
204
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 e...
分类:
其他好文 时间:
2014-06-18 22:11:44
阅读次数:
200
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-06-18 12:56:59
阅读次数:
155
题目
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" ...
分类:
其他好文 时间:
2014-06-17 21:34:00
阅读次数:
189
题目
Determine whether an integer is a palindrome. Do this without extra space.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to ...
分类:
其他好文 时间:
2014-06-17 16:12:39
阅读次数:
226
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-06-15 19:26:23
阅读次数:
207
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 bin...
分类:
其他好文 时间:
2014-06-15 09:34:35
阅读次数:
226
题目
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
原题链接(点我)
解题思路
这题和Search in Rotated Sorted Array问题类似,...
分类:
其他好文 时间:
2014-06-14 12:44:18
阅读次数:
266
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 giv...
分类:
其他好文 时间:
2014-06-13 16:09:02
阅读次数:
237
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?解题分析:大致思想就是设置两个指针,一个指针每次...
分类:
其他好文 时间:
2014-06-13 14:41:54
阅读次数:
238