随笔分类 -  拓扑

摘要:这是一道拓扑排序题;View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;class AOV{public: int num; AOV *next;};cl 阅读全文
posted @ 2012-07-04 10:18 wutaoKeen 阅读(107) 评论(0) 推荐(0)
摘要:该题是一道拓扑排序,拓扑排序就是每次寻找入度为0的节点,如果没有入度为0的节点但节点并没有完全找出,则该排名失败了;由于没有图,不好解释,建议你去看一下数据结构,我这里实现的是链表的方法:#include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct AOE{ int n; struct AOE *next;}AOE;struct T{ int n,flag; AOE *next;}VEX[524]; void build( int x, int y) //建立表{ AOE *p; if 阅读全文
posted @ 2011-08-05 11:34 wutaoKeen 阅读(192) 评论(0) 推荐(0)