图论算法总结及图论建模.pptxVIP

  • 1
  • 0
  • 约4.79千字
  • 约 121页
  • 2019-11-28 发布于上海
  • 举报
;图的基本概念 ;;;;;;;;;;;;一、宽度优先遍历(BFS) 二、深度优先遍历(DFS);;;;;;;;;;;;;;;;;;;;;;完整代码;;;procedure tarjan(u:longint); var p:node; v:longint; begin f[u]:=false;inc(top);stack[top]:=u; instack[u]:=true;p:=head[u]; inc(time);dfn[u]:=time;low[u]:=time; while p^.keyu do begin v:=p^.key; if f[v] then begin tarjan(v); low[u]:=min(low[u],low[v]); end else begin if instack[v] then low[u]:=min(low[u],dfn[v]); end; p:=p^.next; end; ; begin read(n); for i:=1 to n do begin new(head[i]); head

文档评论(0)

1亿VIP精品文档

相关文档