Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST'...
分类:
其他好文 时间:
2015-10-04 12:21:57
阅读次数:
179
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-10-04 12:20:39
阅读次数:
174
Not hard to think of a solution. But the key is all details.class Solution {public: /** *@param n: Given a decimal number that is passed in as ...
分类:
其他好文 时间:
2015-10-04 12:20:18
阅读次数:
257
Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the...
分类:
其他好文 时间:
2015-10-04 12:18:38
阅读次数:
101
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ...
分类:
其他好文 时间:
2015-10-04 11:07:36
阅读次数:
137
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which...
分类:
其他好文 时间:
2015-10-04 11:06:49
阅读次数:
121
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-10-04 11:02:20
阅读次数:
115
S-TreesTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionA Strange Tree (S-tree) over the variable setis a binary...
分类:
其他好文 时间:
2015-10-04 11:00:16
阅读次数:
219
题目如下所示:返回的结果是一个Node的Vector:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your prog...
分类:
其他好文 时间:
2015-10-03 23:13:24
阅读次数:
444
Total Accepted:83663Total Submissions:200541Difficulty:EasyGiven two binary trees, write a function to check if they are equal or not.Two binary trees...
分类:
其他好文 时间:
2015-10-03 21:58:55
阅读次数:
164