0 votes 0 votes Algorithms algorithms breadth-first-search graph-algorithm numerical-answers test-series + – VS asked Nov 26, 2017 retagged Jul 14, 2022 by makhdoom ghaya VS 931 views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments Mk Utkarsh commented Nov 26, 2017 reply Follow Share If you're considering that II is right then III can't be right because II)acdebf is right because we are following the alphabetical order on the last level nodes (b and f) hence then III is incorrect 0 votes 0 votes VS commented Nov 26, 2017 reply Follow Share @SHUBHAMSHASTRI no need to hide your answer.What really matters that you took out your precious time and put in efforts to answer a question,right or wrong is not a concern.See,I am no expert , I am here for learning and I may be wrong also.But,I think this is the every essence of this platform that we discuss and reach a right answer and in the process each one of us learn something new. :) And here I agree with @Mk Utkarsh. I think I misunderstood the question Considering the statement: At any level vertices are visited in alphabetical order I feel even in level 2 it is true.So, correct ans is III only. 2 votes 2 votes SHUBHAM SHASTRI commented Nov 26, 2017 reply Follow Share ok.. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes only 1 sequence possible which is option=3)ACDEFB SHUBHAM SHASTRI answered Nov 26, 2017 reshown Nov 26, 2017 by SHUBHAM SHASTRI SHUBHAM SHASTRI comment Share Follow See all 3 Comments See all 3 3 Comments reply VS commented Nov 26, 2017 reply Follow Share Why II is wrong? I think BFS can be implemented in various ways. The only criteria that we need to consider in a BFS is that : Start from source -->Traverse all level1 nodes(i.e. nodes that are a unit distance away)-->Traverse all level2 nodes(i.e. nodes that are a 2units distance away) and so on. Now, it is given in question that all adjacent nodes are traversed in alphabetical order So, (I)acdbef surely wrong. But, according to me here, it is not given as to how BFS is implemented. So,both (II)acdebf and (III)acdefb should be correct. But, if we consider the default queue implementation of BFS as given in CLRS.Then, only (III)acdefb is correct. 0 votes 0 votes SHUBHAM SHASTRI commented Nov 26, 2017 reply Follow Share here in question they said that a is starting vertex...so i got this only ...can you pls explain how other option is correct?? 0 votes 0 votes saxena0612 commented Nov 26, 2017 reply Follow Share @shubham in last instance of queue efb should be ==> bef 0 votes 0 votes Please log in or register to add a comment.