The problem: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 con...
分类:
其他好文 时间:
2015-01-09 00:07:50
阅读次数:
208
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42497857
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partiall...
分类:
其他好文 时间:
2015-01-08 21:42:06
阅读次数:
246
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...
分类:
其他好文 时间:
2015-01-08 12:57:43
阅读次数:
171
题目:
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
思路:使用快慢两个指针。开始时,两个指针同时指向head,之后slow每次前行一步,fast每次前行两步。如果链表有环,这两个指针一定会相遇,如果没有...
分类:
编程语言 时间:
2015-01-07 13:16:22
阅读次数:
172
问题描述:
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 =...
分类:
其他好文 时间:
2015-01-06 23:14:33
阅读次数:
229
org.hibernate.MappingException: Could not determine type for: java.util.List 感谢http://nvry.iteye.com/blog/1729436 结论:用注解标注的映射关系 要么写在字段上,要么写在getter上,不能混合使用,否则会...
分类:
移动开发 时间:
2015-01-06 12:12:29
阅读次数:
178
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...
分类:
其他好文 时间:
2015-01-05 08:16:36
阅读次数:
147
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan...
分类:
其他好文 时间:
2015-01-05 07:02:29
阅读次数:
229
Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos...
分类:
其他好文 时间:
2015-01-04 22:44:54
阅读次数:
263
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.Fo...
分类:
其他好文 时间:
2015-01-02 15:50:42
阅读次数:
124