Graph
iteye_17352
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode - Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for each...原创 2015-06-29 21:59:29 · 148 阅读 · 0 评论 -
Leetcode - Course Schedule
[分析] 拓扑排序的经典应用。review时发现自己搞反了课程直接的依赖关系,但却真切地被Accept, 图上画了画,发现搞反后若输出排序结果就是和原来相反,但不影响本题的正确性。 网上搜了搜逆拓扑,发现其是有可用之处的,参见下面这篇博文: [url]http://blog.youkuaiyun.com/guodongxiaren/article/details/37988833[/url] 另一篇...原创 2015-09-03 20:21:41 · 147 阅读 · 0 评论 -
Leetcode - Course Schedule II
[分析] 在题I代码基础上增加记录拓扑遍历顺序即可。 [code="java"] public class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { if (prerequisites == null) return new i...原创 2015-09-03 21:05:02 · 142 阅读 · 0 评论 -
Leetcode - Alien Dictionary
There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the dictionary, where words are sorted lexicographica...原创 2015-09-04 11:58:26 · 135 阅读 · 0 评论
分享