0 0 votes Is there any graph whose number of BFS and DFS traversals are different?If so which graph. Programming in C breadth-first-search data-structures + – AIkiran01 1.5k views answer comment Share Follow Print See all 13 Comments 13 13 Comments reply srestha commented Aug 5, 2018 reply Follow flag bfs and dfs traversal always different what u mean by this? 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag He is not talking about order of the vertices, he means finally the no.of BFS traversal orders and the no.of DFS taversal orders are equal or not? if not, give that graph. yes, No.of traversal BFS and DFS orders are equal. 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag order means ?? One printing it's all children once another printing depth wise vertices 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag printing means, in BFS or DFS, a-b-c is different than a-c-b, where a is connected to b and a is connected to c 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag but BFS takes many orders right?? because, it can arrange the order of child But in case of DFS, we can get only one order how more than one order in DFS? 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag How many DFS orders possible? is only 1? No... Start with vertex A, you get 2 DFS orders... like that starts with B or C... 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag oh if there is a loop, then only more than one order for DFS rt? 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag if there is a loop, then only more than one order for DFS remove the edge btw, B and C, then also 2 DFS orders possible right 1)A-B-C 2)A-C-B 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag if starting vertex A and ending vertex C then maximum depth is A-B-C otherwise we cannot visit maximum depth 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag we doesn't need to visit maximum depth 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag is it? I read in iitD lecture it goes to maximum depth 0 0 replyShare Shaik Masthan commented Aug 5, 2018 reply Follow flag In some cases we visit maximum depth, example complete graph... But it's not needed for every case 0 0 replyShare srestha commented Aug 5, 2018 reply Follow flag Any example u got where it is told, it is not going max depth, only required depth? I think u may correct, Still no reference but if u take subgraph in case of DFS then how No.of traversal BFS and DFS orders are equal. is correct? 0 0 replyShare Please log in or register to add a comment.