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 represents the number 123.
Find the tota...
分类:
其他好文 时间:
2015-05-24 10:12:08
阅读次数:
109
题目:
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 ne...
分类:
编程语言 时间:
2015-05-24 08:58:44
阅读次数:
115
二分查找代码://============================================================================// Name : BinarySearch.cpp// Author : Danny// Version...
分类:
其他好文 时间:
2015-05-24 06:29:07
阅读次数:
188
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:
编程语言 时间:
2015-05-23 22:40:17
阅读次数:
190
Search in a Binary Search TreeTo search a key in a binary search tree, we start from the root and move all the way down, choosing branches according t...
分类:
其他好文 时间:
2015-05-23 22:30:29
阅读次数:
169
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-05-23 21:22:23
阅读次数:
152
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-05-23 21:19:39
阅读次数:
155
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le...
分类:
编程语言 时间:
2015-05-23 21:16:50
阅读次数:
170
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-05-23 21:16:11
阅读次数:
196
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:同上题,JAVA实现如下: public TreeNode sor...
分类:
编程语言 时间:
2015-05-23 21:13:59
阅读次数:
145