JsRender DemosExample Scenario: Accessing parent data.Stepping up through the views (tree of nested rendered templates) TitleLang...
分类:
Web程序 时间:
2014-08-03 15:10:25
阅读次数:
294
Consider an infinite full binary search tree (see the figure below), the numbers in the nodes are 1, 2, 3, .... In a subtree whose root node is X, we can get the minimum number in this subtree by repe...
分类:
其他好文 时间:
2014-08-03 12:49:15
阅读次数:
229
HDU 1325 Is It A Tree?
并査集...
分类:
其他好文 时间:
2014-08-03 10:21:25
阅读次数:
220
问题:将二叉树的所有结点指向他的右边的一个结点分析:对于每一个结点来说,其操作都是一样的,除了他的左儿子指向右儿子外,其左儿子的全部右后辈均指向其右儿子的全部左后辈/** * Definition for binary tree with next pointer. * struct TreeLin...
分类:
其他好文 时间:
2014-08-03 10:12:05
阅读次数:
178
1.http://sourceforge.net/p/cutycapt/code/HEAD/tree/CutyCapt/svn checkout http://svn.code.sf.net/p/cutycapt/code/ cutycapt-code下载的代码结构cutycapt-code/Cut...
分类:
其他好文 时间:
2014-08-03 01:40:44
阅读次数:
388
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.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-08-02 23:32:04
阅读次数:
232
二叉树的深度的概念最值得注意的地方,在于 到"叶子"节点的距离。一般来说,如果直接说“深度”,都是指最大深度,即最远叶子的距离。这里放两道例题,最小深度和最大深度。1. 二叉树的最小深度Given a binary tree, find its minimum depth.The minimum d...
分类:
其他好文 时间:
2014-08-02 23:17:44
阅读次数:
243
题意:二叉树的最小深度注意 1.当root为空的时候直接返回0,因为MIN赋值很大,所以如果不单独预判的话会返回MIN 2.判断树的深度应该到叶子节点,也就是左右子结点都为空的那个结点 3.树的深度的根节点深度为1class Solution {public: void dfs(...
分类:
其他好文 时间:
2014-08-02 20:39:13
阅读次数:
233
题意:给你一个K叉数,每个节点都一定有K 个子节点,且到这K个子节点的费用为1-k,问你 费用总和为n且最少需要走过一条 d-k的边的概率解题思路:分成两个二维DP,一个表示没有走过的,一个表示走过的,即可dp求出解题代码: 1 /**********************************...
分类:
其他好文 时间:
2014-08-02 17:55:34
阅读次数:
170