edited by
2,600 views
2 votes
2 votes

How many times 8 is pushed into stack ? a detail answer will be welcomed.

edited by

1 Answer

Best answer
5 votes
5 votes

Given graph according to adjacency list . Answer will be 3.

 Solution :

X means already visted  and Down arrow means need to check.

selected by

Related questions

2.1k
views
0 answers
2 votes
Shubhanshu asked Oct 18, 2017
2,053 views
I have seen these following question:-Number of Vertices pushed more than once.https://gateoverflow.in/5296/number-of-vs-that-are-pushed-more-than-once-in- ... into the stackhttp://www.geeksforgeeks.org/depth-first-traversal-for-a-graph/.
499
views
1 answers
0 votes
Ayush Upadhyaya asked Aug 28, 2018
499 views
I want to find the articulation point and bridges in the above graph. Further for each vertex $v$ I want to compute$v.low=$ ... based on v.low I will be further able to solve articulation point and bridge problem.
445
views
0 answers
0 votes
iarnav asked May 13, 2018
445 views
I know, Kosaraju algorithm and there's one other algorithm which involves reversing of G and using DFS, but two times, but there's some algorithm which uses DFS only time, but I can't be able find that algorithm. Someone please share that.
923
views
1 answers
3 votes
admin asked Mar 31, 2020
923 views
What data structures is used for depth first traversal of a graph?QueueStackListNone of the above