题目意思:一个N 个节点的苹果树,每个节点有一定数目的苹果;问从1 出发走K步 所能迟到的苹果(每一步只可以到相邻的节点) 解法: 走法包含以下基本的情况(其他的走法都可以由以下的组合出来): 1:在树上头也不回的往前; 2:回到走过的节点再去别的节点: 所以对于每个节点有一个 flag ...
分类:
移动开发 时间:
2014-07-30 12:02:03
阅读次数:
212
题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3...
分类:
编程语言 时间:
2014-07-30 11:33:23
阅读次数:
258
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...
分类:
其他好文 时间:
2014-07-30 11:30:33
阅读次数:
247
Nick's company employed n people. Now Nick needs to build a tree hierarchy of «supervisor-surbodinate» relations in the company (this is to say that each
employee, except one, has exactly one superv...
分类:
其他好文 时间:
2014-07-30 10:06:53
阅读次数:
286
题目:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3...
分类:
编程语言 时间:
2014-07-30 09:54:33
阅读次数:
195
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,...
分类:
编程语言 时间:
2014-07-30 09:49:43
阅读次数:
177
在昨天用finger及tree指令时发现Linux默认情况下未安装这两个指令。于是就自己尝试了下安装这两个指令。在进行操作前我们要有一个明确的思路,这样我们实际进行时可以事半功倍。这两个文件安装有两种途径:1,上网下载安装;2,通过Linux的安装ISO文件进行安装。我用的是第二种..
分类:
系统相关 时间:
2014-07-30 03:31:53
阅读次数:
452
决策树(Decison Tree)之所以称为树是因为其建模过程类似一棵树的成长过程,即从根部开始,到树干,到分支,再到细枝末叶的分叉,最终胜出出一片片的树叶。在数据树里面,所分析的数据数据样本先是成为一个树根,然后经过层层分支,最终形成若干个节点,每个节点代表一个结论。 决策树算法之所以在数据...
分类:
其他好文 时间:
2014-07-30 03:16:42
阅读次数:
257
Demo这绝对是我见过最完美的tree了,尽管是国产货,但一点不输国外产品,国外的还没有见过这么强的。__________________________________________________________________________________以下是简单的使用demo: ...
分类:
Web程序 时间:
2014-07-30 00:25:12
阅读次数:
267
Genealogical tree
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 2920 Accepted: 1962 Special Judge
Description
The system of Martians' blood relations is confusing enough. Actually, ...
分类:
其他好文 时间:
2014-07-29 22:10:42
阅读次数:
533