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.
点击打开原题链接
这个题剑指offer里也有,简单的递归即可,代码很清晰:...
                            
                            
                                分类:
其他好文   时间:
2014-10-05 22:56:09   
                                阅读次数:
185
                             
                    
                        
                            
                            
                                题目链接
题意:问要添加几条边才能使所给无向图图变成边双连通图。
思路:一个有桥的连通图,如何把它通过加边变成边双连通图?方法为首先求出所有的桥,然后删除这些桥边,剩下的每个连通块都是一个双连通子图。把每个双连通子图收缩为一个顶点,再把桥边加回来,最后的这个图一定是一棵树,边连通度为1。
统计出树中度为1的节点的个数,即为叶节点的个数,记为leaf。则至少在树上添...
                            
                            
                                分类:
其他好文   时间:
2014-10-04 00:30:55   
                                阅读次数:
201
                             
                    
                        
                            
                            
                                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},
...
                            
                            
                                分类:
其他好文   时间:
2014-10-03 19:41:45   
                                阅读次数:
189
                             
                    
                        
                            
                            
                                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
...
                            
                            
                                分类:
其他好文   时间:
2014-10-02 18:26:13   
                                阅读次数:
174
                             
                    
                        
                            
                            
                                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
             /     ...
                            
                            
                                分类:
其他好文   时间:
2014-10-02 18:25:03   
                                阅读次数:
153
                             
                    
                        
                            
                            
                                Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-l...
                            
                            
                                分类:
其他好文   时间:
2014-10-02 03:56:22   
                                阅读次数:
198
                             
                    
                        
                            
                            
                                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...
                            
                            
                                分类:
其他好文   时间:
2014-09-28 18:02:24   
                                阅读次数:
182
                             
                    
                        
                            
                            
                                1、索引结构。第一张图是索引的官方图解,右侧是存储方式的图解。图中很清晰的展示了索引存储的状况。在leaf 节点中存储了一列,索引所对应项的 :值,rowId,长度,头信息(控制信息)这样我们就能很清楚、如果通过索引查找数据,而只需要这个索引的值的时候,写上列名,就可以不需要回表。2、索引在一般的数...
                            
                            
                                分类:
数据库   时间:
2014-09-25 02:33:18   
                                阅读次数:
488
                             
                    
                        
                            
                            
                                【求最大深度】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.
这里说的最大深度是指最深叶子节点到根节点的路径长度
...
                            
                            
                                分类:
其他好文   时间:
2014-09-24 16:09:37   
                                阅读次数:
200
                             
                    
                        
                            
                            
                                【题目】
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.
Fin...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 19:30:53   
                                阅读次数:
175