edited by
412 views
2 votes
2 votes

Consider the following graph and sequences given below :

Given answer for no of DFS traversal was 2 : S1 and S2.

How S2 is a DFS traversal ?

edited by

1 Answer

0 votes
0 votes
Yes answer is right S2 is correct .

A ---> C ---> D --->E --->B now we will have no new node to visit again therefore backtrack from B and check unvisited node unvisited node from B is F therefore

A ---> C ---> D --->E --->B--->F is also one DFS path

Related questions

2 votes
2 votes
0 answers
2
jaig asked Jan 10, 2018
325 views
For a directed graph, the absence of back edges in a DFS tree can have cycle.true or fale.please explain with an example.
1 votes
1 votes
0 answers
4
charul asked Jan 12, 2018
697 views
What is the worst case time complexity to count pairs of numbers with difference ‘k’ from an input array of ‘n’ numbers?a) O(logn)b) O(nlogn)c) O(n^2)d) O(n^2logn...