0 votes 0 votes Shadan Karim asked Dec 30, 2018 Shadan Karim 535 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments Magma commented Dec 30, 2018 reply Follow Share Nice 1 votes 1 votes kumar.dilip commented Dec 30, 2018 reply Follow Share Magma what will be the size of the $stack$ in case of $DFS$ ??? 0 votes 0 votes aambazinga commented Jan 2, 2019 reply Follow Share if considering the worst case, then the minimum size should be 5. if starting from node C, first enqueue B,E,G,D. then dequeue B and enqueue all it's neighbour. so queue will now look like.. E,C,G,D,A,F. this is the maximum elements possible at one time in the queue. isn't it? please correct me if i'm wrong. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Well in worst case answer will be 4. If you start bfs from E, ans will be 4. So a min. Queue size of 4 is reqd. With a queue of size 3, you can't do bfs from E. Kunal Kadian answered Dec 30, 2018 Kunal Kadian comment Share Follow See all 0 reply Please log in or register to add a comment.