Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
分类:
其他好文 时间:
2014-10-22 12:29:07
阅读次数:
171
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 andsum =...
分类:
其他好文 时间:
2014-10-22 07:36:22
阅读次数:
218
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-10-22 01:06:01
阅读次数:
162
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2014-10-21 23:05:01
阅读次数:
223
Given two binarytrees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and...
分类:
其他好文 时间:
2014-10-21 23:02:04
阅读次数:
240
Given a binary tree,find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest lea...
分类:
其他好文 时间:
2014-10-21 22:58:39
阅读次数:
235
给定一个二叉树,以集合方式返回其中序/先序方式遍历的所有元素。有两种方法,一种是经典的中序/先序方式的经典递归方式,另一种可以结合栈来实现非递归Given a binary tree, return theinordertraversal of its nodes' values.For examp...
分类:
其他好文 时间:
2014-10-21 22:49:08
阅读次数:
269
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-10-21 22:48:09
阅读次数:
266
Minimum Depth of Binary Tree...
分类:
其他好文 时间:
2014-10-21 21:29:04
阅读次数:
170
Populating Next Right Pointers in Each Node TotalGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next...
分类:
其他好文 时间:
2014-10-21 21:06:24
阅读次数:
247