//對連通圖從頂點(diǎn)v開始用visit()先廣訪問void AdjMWGraph::BroadFirstSearch(const int v, int visited[],void visit(VerT item)){VerT u,w;SeqQueue queue; //定義隊(duì)列queuevisit(GetValue(v));visited[v]=1;queue.QInsert(v);while(!queue.QueueEmpty()){u=queue.QDelete();w=GetFirstNeighbor(u);while(w!=-1){if(!visited[w]){visit(GetValue(w));visited[w]=1;queue.QInsert(w);}w=GetNextNeighbor(u,w);}}}g.BroadFirstSearch(0,visited,Printchar);
我看不到有這個(gè)printchar的定義?。渴裁辞闆r?
慕絲7291255
2022-08-04 15:11:17