int main(){ AdjList *G; int indegree[MAXVEX] = {0}; G = (AdjList *)malloc(sizeof(struct AdjList)); AdjList_create(G); Topsort(G,indegree); }
int main() { Graph G; Table HT; int N; scanf("%d", &N); HT = Read(N); /* 读入哈希表 */ G = ConstructG(HT, N); /* 根据哈希表建立有向图 */ Topsort(G, HT, N); /* 拓扑排序得到解并输出 */ return 0; }