Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Consider the following graph :

    Among the following sequences
    1. abeghf 2. abfehg 3. abfhge 4. afghbe
    Which are depth first traversals of the above graph?
    1. 1, 2 and 4
    2. 1 and 4
    3. 2, 3 and 4
    4. 1, 3 and 4
Correct Option: D

DFS traversal takes the path to the end & then move to other branch.

Hence option (d) is correct.



Your comments will be displayed only after manual approval.