
拓扑排序
文章平均质量分 82
_Ngone
这个作者很懒,什么都没留下…
展开
-
poj1094 Sorting It All Out
链接:http://poj.org/problem?id=1094 题意:题目的意思很简单。就是给定一些字母之间的先后关系,然后对其排序。 排序的结果有三种:一、唯一的序列;二、存在矛盾(即有环);三、无法确定序列。总的来说是这三种,但每种又有好多种情况!!!这个是本题的难点,要把所有的情况都搞清楚。然后我说一下具体的情况:1、序列唯一。如果在输入了w条边后,序列已确定,即包含了所有前n个顶点原创 2013-11-21 21:28:29 · 597 阅读 · 0 评论 -
poj1308 Is It A Tree
链接:http://poj.org/problem?id=1308 题意:给一个图,判断是不是树。题目中给的判断条件是: 1.There is exactly one node, called the root, to which no directed edges point. 2.Every node except the root has exactly one edge poin原创 2014-03-24 19:16:08 · 347 阅读 · 0 评论