随笔分类 - 拓扑
摘要:这是一道拓扑排序题;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
阅读全文
摘要:该题是一道拓扑排序,拓扑排序就是每次寻找入度为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
阅读全文

浙公网安备 33010602011771号