Question #49: For the following graph, let’s assume A is the starting node and we traverse the graph using DFS (Depth First Search) in lexical order. What would be the order of traversal?
Options:
- A, B, C, G, D, H, F, E
- A, B, C, F, G, D, H, E
- A, E, B, C, F, G, D, H
- A, E, B, F, D, G, D, H
Solution: A would be followed by B instead of E or F to follow the lexical order. Now, after B would be C. Similarly after C, F would be preferred instead of G and so on. 2nd option is the right answer.
