2 votes 2 votes Algorithms made-easy-test-series cbt-2017 algorithms graph-algorithms + – Dulqar asked Jan 22, 2017 • edited Mar 6, 2019 by adeebafatima1 Dulqar 619 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes I think running Depth First Search will be enough to calculate the depth of The DAG so complexity O(V+E) so b shouldd be correct Aboveallplayer answered Jan 22, 2017 • selected Jan 24, 2017 by Sushant Gokhale Aboveallplayer comment Share Follow See all 3 Comments See all 3 3 Comments reply Akriti sood commented Jan 27, 2017 reply Follow Share what about undirected graph??then also we can do BFS or DFS righht??i guess BFS would be more preferrable 0 votes 0 votes Aboveallplayer commented Jan 28, 2017 reply Follow Share same for undirected graphs 0 votes 0 votes Sandeep Suri commented Jan 28, 2017 reply Follow Share Question asked for worst case not best case. 0 votes 0 votes Please log in or register to add a comment.