使用组合模式的场景; -- 把部分和整体的关系用树形结构来表示,从而使客户端可以使用统一的方式处理部分对象和整体对象。核心: -- 抽象构件(Component)角色:定义了叶子和容器构件的共同点 -- 叶子(Leaf)构件橘色:无子节点 -- 容器(Composite)构件角色: 有容器特...
分类:
其他好文 时间:
2015-04-15 18:36:24
阅读次数:
114
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-14 14:25:32
阅读次数:
123
Oracle 索引的 dump leaf block...
分类:
数据库 时间:
2015-04-10 17:50:53
阅读次数:
191
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 =...
分类:
其他好文 时间:
2015-04-10 15:14:35
阅读次数:
125
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-04-10 12:56:54
阅读次数:
109
题意Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.思路基本的深搜,注意一点就是必须是根到叶子节点求和,不可在非叶子节点处停。代码/**
* Definition for binary tree
* struct TreeNode {
*...
分类:
其他好文 时间:
2015-04-09 17:25:31
阅读次数:
147
题目:
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.
Fi...
分类:
其他好文 时间:
2015-04-09 11:51:56
阅读次数:
161
又一道DFS题,题意如下:
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-04-08 09:12:40
阅读次数:
116
一道DFS的题目,题意如下:
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 1...
分类:
其他好文 时间:
2015-04-08 09:12:29
阅读次数:
107
Path SumGiven 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 give...
分类:
编程语言 时间:
2015-04-08 06:35:37
阅读次数:
186