问题描述: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may o
现在要构建一个网络模型,网络中的每个节点最多和 d 个节点相连接, 且信息的传播从任意一个节点到另外任意一个节点的“最短路径” (路径按照单位路径算)都不能超过 k,问网络中最多安排多少个节点。 这是《图论导引》里面看到的 diameter - degree 问题。 转化为图模型就是,一个无向图 G 中,节点最大度为 d,直径为 k,问 G 中的 n 上界。 书上要证明的是: n ≤