chinesecoder's blog

By chinesecoder, history, 6 years ago, In English

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

  • Vote: I like it
  • -4
  • Vote: I do not like it

| Write comment?