
树的直径
浅眠流转
这个作者很懒,什么都没留下…
展开
-
Farthest Nodes in a Tree
Farthest Nodes in a TreeGiven 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 fi...原创 2019-07-25 23:13:42 · 170 阅读 · 0 评论 -
Computer
E-Computer描述一所学校不久前买了第一台电脑(所以这台电脑的ID是1)。近年来,学校购买了N-1新电脑。每台新电脑都连接到一台先前安装的电脑上。学校的管理人员担心网络运行缓慢,希望知道第i台计算机需要发送信号的最大距离si(即到最远计算机的电缆长度)。您需要提供此信息。提示:示例输入与此图对应。从图中,你可以看到计算机4离1最远,所以s1=3。计算机4和5是距离2最远的,所以...原创 2019-07-28 00:44:47 · 391 阅读 · 0 评论