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-08-29 22:42:32
阅读次数:
328
[ 问题: ]
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 al...
分类:
其他好文 时间:
2014-08-29 16:11:48
阅读次数:
195
LeetCode: Validata Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The l...
分类:
其他好文 时间:
2014-08-28 23:59:16
阅读次数:
421
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 n...
分类:
其他好文 时间:
2014-08-28 20:57:46
阅读次数:
201
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. *...
分类:
其他好文 时间:
2014-08-28 19:41:25
阅读次数:
224
[ 问题: ]
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
直译:给你一个字符串, 判定它是否是回文(只统计字母、数字,其他字符请忽略)。...
分类:
其他好文 时间:
2014-08-28 09:45:09
阅读次数:
204
LeetCode: Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a ...
分类:
其他好文 时间:
2014-08-27 21:51:38
阅读次数:
199
Palindrome Number
Total Accepted: 19369 Total
Submissions: 66673My Submissions
Determine whether an integer is a palindrome. Do this without extra space.
判断一个数整数是不是回文?例如121,122...
分类:
其他好文 时间:
2014-08-27 01:40:27
阅读次数:
180
LeetCode: Path SumGiven 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 equal...
分类:
其他好文 时间:
2014-08-27 00:07:27
阅读次数:
298
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...
分类:
其他好文 时间:
2014-08-26 19:11:06
阅读次数:
193