Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

参考《算法导论》有关DFS 的 finishing time 的介绍便知 (p540)

Posted by 041221125 at 2006-06-21 21:53:06
In Reply To:弱弱的问一个关于欧拉路算法的很基本的问题 Posted by:Ikki at 2006-06-21 21:25:30
> 基于dfs的无向图的欧拉路的套圈法我们一般是这样写的
> void euler(int now)
> {
>     for(int i=0;i<n;i++)
>         if(gr[now][i])
>         {
>            gr[now][i]--;
>            gr[i][now]--;
>            euler(i);
>         }
>     st[top++]=now;
> }
> 
> 我想问一下,为什么st[top++]=now在这里是在euler()函数的最后
> 而不是开始呢?这个究竟是怎么证明的呢?
> 望告知,谢谢:)

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator