0 votes 0 votes Shadan Karim asked Dec 30, 2018 Shadan Karim 489 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Shubhanshu commented Dec 30, 2018 reply Follow Share Is it $3$? 0 votes 0 votes Magma commented Dec 30, 2018 reply Follow Share Yeah 3 0 votes 0 votes Shadan Karim commented Dec 30, 2018 reply Follow Share i also got 3 , but the answer given is 4 0 votes 0 votes Shubhanshu commented Dec 30, 2018 reply Follow Share Post their provided solution. 0 votes 0 votes kumar.dilip commented Dec 30, 2018 reply Follow Share here not given which node have to choose. I think we have to go to the worst case. When we select the node E, or B, C , G, or F node. Then size will be 4. 2 votes 2 votes 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.