本文出自 http://blog.csdn.net/shuangde800
题目传送门
题意:
给出一棵树,求离每个节点最远的点的距离
思路:
把无根树转化成有根树分析,
对于上面那棵树,要求距结点2的最长距离,那么,就需要知道以2为顶点的子树(蓝色圈起的部分,我们叫它Tree(2)),距顶点2的最远距离L1...
分类:
其他好文 时间:
2014-06-05 06:56:39
阅读次数:
226
当我们创建Web Performance and Load Test
Project时,经常会遇到下面这些问题: 1. 当点击Add Recording时, 左边的record tree没有出现: 解决方法: 打开IE
Manage add-ons: Enable “Microsoft Web Te...
分类:
Web程序 时间:
2014-06-03 11:12:59
阅读次数:
369
(转载请注明出处:http://blog.csdn.net/buptgshengod)1.背景
接着上一节说,没看到请先看一下上一节关于数据集的划分数据集划分。如今我们得到了每一个特征值得信息熵增益,我们依照信息熵增益的从大到校的顺序,安排排列为二叉树的节点。数据集和二叉树的图见下。(二叉树的图是....
分类:
编程语言 时间:
2014-06-03 07:23:48
阅读次数:
325
1查找字符位置函数:strpos($str,search,[int]):查找search在$str中的第一次位置从int开始;stripos($str,search,[int]):函数返回字符串在另一个字符串中第一次出现的位置。该函数对大小写不敏感strrpos($str,search,[int])...
分类:
Web程序 时间:
2014-05-31 14:07:06
阅读次数:
329
在Android源码中发现,会如下使用:dlsym(RTLD_DEFAULT, name);也就是说
handle=RTLD_DEFAULT,在网上查了下,大致是说会在当前进程中按照 default library search
order搜索name这个symbol。其中RTLD_DEFAULT=...
分类:
其他好文 时间:
2014-05-31 13:12:22
阅读次数:
196
KEYCODE_CALL 拨号键 5KEYCODE_ENDCALL 挂机键 6KEYCODE_HOME
按键Home 3KEYCODE_MENU 菜单键 82KEYCODE_BACK 返回键 4KEYCODE_SEARCH 搜索键 84KEYCODE_CAMERA
拍照键 ...
分类:
其他好文 时间:
2014-05-31 11:34:41
阅读次数:
377
linux有自己一套完整的启动体系,抓住了linux启动的脉络,linux的启动过程将不再神秘。本文中假设inittab中设置的init
tree为:/etc/rc.d/rc0.d/etc/rc.d/rc1.d/etc/rc.d/rc2.d/etc/rc.d/rc3.d/etc/rc.d/rc4.d...
分类:
其他好文 时间:
2014-05-31 04:12:54
阅读次数:
335
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...
分类:
其他好文 时间:
2014-05-30 15:18:35
阅读次数:
246
Given an array where elements are sorted in
ascending order, convert it to a height balanced BST./** * Definition for binary
tree * struct TreeNode { ...
分类:
其他好文 时间:
2014-05-30 15:10:23
阅读次数:
227
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 le...
分类:
其他好文 时间:
2014-05-30 15:03:42
阅读次数:
237