Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

dfs recursion meaning !

Revision en2, by chinesecoder, 2019-01-12 00:36:47

suppose we are doing dfs on tree .

Your code here...

dfs(int current ,  int parent)
{
     for(auto child : v[current]
    {
        if(child == parent) continue ;
        dfs(child , current);
         code...
       what happens when we write something here. 
        
}
code .... 
And what happens when we write something here ... 

}

what are the difference between two above .

Please tell , i have difficulty in distinguishing between two

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English chinesecoder 2019-01-12 00:36:47 66
en1 English chinesecoder 2019-01-12 00:22:59 445 Initial revision (published)