题目描述
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursi...
分类:
其他好文 时间:
2015-05-10 17:20:16
阅读次数:
118
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
...
分类:
其他好文 时间:
2015-05-10 17:19:39
阅读次数:
92
1.Maximum Depth of Binary Tree这是道简单的分治习题了分:左子树最大深度右子树最大深度治:最大深度等于max(左子树,右子树)+1public class Solution { public int maxDepth(TreeNode root) { ...
分类:
编程语言 时间:
2015-05-10 15:29:25
阅读次数:
1098
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive soluti...
分类:
其他好文 时间:
2015-05-10 09:56:42
阅读次数:
123
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
= 22,
5
/ ...
分类:
其他好文 时间:
2015-05-10 09:43:32
阅读次数:
103
UniqueBinarySearchTreesTotalAccepted:47684TotalSubmissions:131223MySubmissionsQuestionSolutionGivenn,howmanystructurallyuniqueBST‘s(binarysearchtrees)thatstorevalues1...n?Forexample,Givenn=3,thereareatotalof5uniqueBST‘s.13321
\///\321132
//\2123ShowTags..
分类:
其他好文 时间:
2015-05-09 20:36:17
阅读次数:
93
https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ http://www.lintcode.com/zh-cn/problem/binary-tree-level-order-traversal-ii/# Given...
分类:
其他好文 时间:
2015-05-09 20:21:42
阅读次数:
140
https://leetcode.com/problems/binary-tree-level-order-traversal/ http://www.lintcode.com/zh-cn/problem/binary-tree-level-order-traversal/# Given a bin...
分类:
其他好文 时间:
2015-05-09 18:52:00
阅读次数:
93
这个比较简单,直接上代码:bitset *b = new bitset(255);bitset *c = new bitset(0);ofstream out("I:\\test.dat",ios::binary);out.write((char *)b,4);out.close();ifstrea...
分类:
编程语言 时间:
2015-05-09 16:26:35
阅读次数:
137
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
...
分类:
其他好文 时间:
2015-05-09 15:04:08
阅读次数:
99