in the topological sort dfs code given in the video there is no mapping for the web development in the adjlist so when we call for the neighbours of it in the dfshelper function what happens?isn’t it goes to infinite loop?
Topological sort dfs issue
@Rj.25
hello Reechika,
Yeah there is no mapping for web development so adjancency list corresponding to web development will be empty therefore loop that calls neigbhours will never execute so no infinite loop
for(auto v : gr[u] ){
** // something **
}
above code never execute becuase gr[u] will be empty
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.