![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
《Introduction to Algorithm》
大爱助手
这个作者很懒,什么都没留下…
展开
-
《Introduction to Algorithm》22.2-8
今天复习看到一题,试着证明了一下,题目简洁很有意思.The diameter of a tree T = (V,E) is defined as maxu,v∈Vδ(u,v)max_{u,v\in V}\delta(u,v)maxu,v∈Vδ(u,v) , that is, the largest of all shortest-path distances in the tree. Giv...原创 2019-12-17 17:50:07 · 183 阅读 · 0 评论 -
《Introduction to Algorithm》22.4-2
Description for 22.4-2Solutions for 22.4-2第22章第4节讲述了拓扑排序的应用,最直观的做法是先利用拓扑排序对图22.8进行DFS从而获得一个拓扑序列T,之后从t开始依次向前扫描处理直到s (利用了有向无环图中无环即无反向边的性质)下图为其中一个拓扑排序:算法一 (求p到v的简单路径数): 1)将所有节点赋值num=0,v赋值num=...原创 2019-01-10 16:04:39 · 362 阅读 · 5 评论