1 votes 1 votes Algorithms depth-first-search algorithms graph-algorithms data-structures test-series + – Shubham Kumar Gupta asked Dec 3, 2017 • retagged Jul 14, 2022 by makhdoom ghaya Shubham Kumar Gupta 1.1k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Red_devil commented Dec 3, 2017 reply Follow Share c should be answer 1 votes 1 votes Shubham Kumar Gupta commented Dec 3, 2017 reply Follow Share can you explain? 0 votes 0 votes air1ankit commented Dec 3, 2017 reply Follow Share Can you please explain.. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes V6(3,8) V3(1,7) V7(8) V8(4,5) V5(2) V2(1,4) V4() V1() because it is DFS use the stack. in bracket i have put the node adjacent to the vertex. Red_devil answered Dec 3, 2017 Red_devil comment Share Follow See 1 comment See all 1 1 comment reply vamp_vaibhav commented Dec 4, 2017 reply Follow Share I think there is something wrong with this solution Plz Cross check.. Because initially while accessing 6 you have inserted 3 and 8 it means they are visited according to algorithm.. You cannot again push 8 while accessing 7 even you can't pop 8 until the above elements are not popped 0 votes 0 votes Please log in or register to add a comment.