Problem Description:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Solution: 递归。 1 public List>...
分类:
其他好文 时间:
2014-07-07 16:59:12
阅读次数:
169
Problem Description:Given a binary tree, return thepostordertraversal of its nodes' valuesSolution: 1 public List postorderTraversal(TreeNode root) { ...
分类:
其他好文 时间:
2014-07-07 16:45:23
阅读次数:
177
树的层次遍历,比较简单,3个题的做法完全一样,只是在特定的地方对结果进行reverse。1、Binary Tree Level Order Traversal/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:
其他好文 时间:
2014-07-07 16:39:56
阅读次数:
194
Problem Description:Given a binary tree, return thepreordertraversal of its nodes' values.Solution: 1 public List preorderTraversal(TreeNode root)...
分类:
其他好文 时间:
2014-07-07 16:34:34
阅读次数:
208
非常简单的一道题/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:
其他好文 时间:
2014-07-07 16:25:49
阅读次数:
220
extjs_07_combobox&tree&chart...
分类:
Web程序 时间:
2014-06-30 10:29:38
阅读次数:
259
在虚拟机下安装了一个centos的minimal镜像,发现增强包不能安装,鼠标不能在虚拟机和物理机间自由切换,不能共享粘贴板,很是不爽,这里摸索出在centos minimal OS下安装增强包的方法...
分类:
其他好文 时间:
2014-06-30 10:16:21
阅读次数:
182
【题目】
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recursive solution is trivial, could you do it iteratively?
【题意】
非递归实现后续遍...
分类:
其他好文 时间:
2014-06-30 10:10:10
阅读次数:
177
【题目】
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 solution is trivial, could you do it iteratively?
【题意】
非递归返回先序遍历...
分类:
其他好文 时间:
2014-06-30 06:21:18
阅读次数:
334
题目
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/...
分类:
其他好文 时间:
2014-06-29 23:16:19
阅读次数:
312