算法
纸箱猪
热衷于创造和制作的技术职人。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
《算法导论(第2版)》习题6.3-3题解
Solution to CLRS 2e Exercise 6.3-3Show that there are at most nodes of height h in any n-element heap.A heap node of index i (starting from 1) is of height h if and only if , or , or since i is an integer. Therefore, the number of nodes of height h in an原创 2011-01-20 17:18:00 · 4334 阅读 · 7 评论 -
《算法导论(第2版)》第20章习题解答
Solutions for Chapter 20 of CLRS 2eLeft Click to Download...原创 2011-01-25 22:41:00 · 1871 阅读 · 0 评论 -
[原创+翻译]《算法导论(第二版)》习题22.1-6:图的通用汇点(Universal Sink)
问题 如果我们用邻接矩阵来存储图,那么绝大多数图算法的运行时间都是Ω(|V|2)(V为一个图的顶点集),但还是有些例外。比如,给定一个有向图G的邻接矩阵A,我们可以在Ο(|V|)时间内判断图G是否包含一个通用汇点,即一个入度为|V|-1出度为0的顶点。请给出这样的算法。 思路 (注:这一段是我从教师手册翻译过来的,和我的思路一样,不过表述和逻辑更清晰。)如果A[i,原创 2012-04-15 14:52:22 · 4569 阅读 · 5 评论
分享