
树的直径
seven yearsº
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Farthest Nodes in a Tree(树的直径)
Given a tree (a connected graph with no cycles), you have to find the farthest nodes in the tree. The edges of the tree are weighted and undirected. That means you have to find two nodes in the tree w...原创 2019-07-25 14:39:10 · 155 阅读 · 0 评论 -
Computer(树的直径)
一所学校不久前买了第一台电脑(所以这台电脑的ID是1)。近年来,学校购买了N-1新电脑。每台新电脑都连接到一台先前安装的电脑上。学校的管理人员担心网络运行缓慢,希望知道第i台计算机需要发送信号的最大距离si(即到最远计算机的电缆长度)。您需要提供此信息。 提示:示例输入与此图对应。从图中,你可以看到计算机4离1最远,所以s1=3。计算机4和5是距离2最远的,所以s2=2。计算机5是离3最远的,所...原创 2019-07-25 15:30:24 · 259 阅读 · 0 评论