func order (g:graph;v:char); txptr; _______; i:=n; while g[i].vexdata<>v do i:=i-1; order:=i; endf;
proc creat (g:graph); readln(n,e); for i:= 1 to n do [ readln(g[i].vexdata); g[i].firstin :=nil ; g[i].firstout:=nil;] for k:= 1 to e do [readln (vt,vh); I:=order (g,vt); j:=order (g,vh); new (p); p^,vexi:=I ; p^.vexj:=j P^.nextj:=____B____;___C____:=p; P^.nexti:=____D____;___E____:=p;] ENDP. Func firstadj(g:fraph:v:char):vtxptr0; I:=order(g,v);p:=g[I].firstout; If p<>nil then firstadj:=______else firstadj:=0; Endf; Func nextadj(g:fraph;v:char:w:char):vtxptr0; I:=order(g,v);j:=order(g,w); P:=______; While(p<>nil ) and(p^.vexj<>j)do _____; If _____and_____then nextadj:=p^.nexti^.vexj else nextadj:=0; Endf; Proc dfs(g:graph;v0:char); Write(v0:2);visited[order(g,v0)]:true; W:=_____ While w<>0 do [ if _____ then dfs(g,g[w].vexdata); w:=______;] endp; proc traver(g:graph); for I;=1 to n do visited[I]:=false; for I:=1 to n do if not visitec[I]then dfs(g,g[I].vexdata); endp; begin creat(ga); traver(ga); end. 四 对 输入文件(101,51,19,61,3,71,31,17,19,100,55,20,9,30,50,6,90)。当k=6时,使用置换-选择算法,写出建立的初始败者及生成的归并段; 五 以孩子兄弟链表为存储结构,请设计递归和非递归算法求树的深度。{书写算法请用类pascal语言}