Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2015-05-05 10:40:01
阅读次数:
113
https://leetcode.com/problems/path-sum/Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values...
分类:
其他好文 时间:
2015-05-05 01:15:10
阅读次数:
184
Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For examp...
分类:
其他好文 时间:
2015-05-04 20:14:35
阅读次数:
182
Path Sum
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 bina...
分类:
其他好文 时间:
2015-05-04 15:30:49
阅读次数:
113
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 leaf node.
题意:求树的高度。
思路:就是递归。
/**
* Definiti...
分类:
其他好文 时间:
2015-05-01 12:06:48
阅读次数:
163
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2015-04-30 19:47:36
阅读次数:
107
同样地,先上uml图:
组合模式的意图:将对象组合合成树形结构以表示“部分-整体”的层次结构。Composite使得用户对单个对象和组合对象的使用具有一致性。
uml解析:leaf是叶节点,Composite可以理解为是一个多个叶节点的组合,它是非叶节点,就相当于一个元件以及一个元件容器,里面有很多元件一样。这里可以用list或者vector实现。
本来是想用模板来实现,后来发现实在是多此...
分类:
其他好文 时间:
2015-04-28 23:03:34
阅读次数:
215
problem:
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...
分类:
其他好文 时间:
2015-04-28 11:48:32
阅读次数:
160
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:
其他好文 时间:
2015-04-27 00:04:32
阅读次数:
179
Path Sum IITotal Accepted:41402Total Submissions:155034My SubmissionsQuestionSolutionGiven a binary tree and a sum, find all root-to-leaf paths where ...
分类:
其他好文 时间:
2015-04-24 22:27:17
阅读次数:
159