The time complexity of the Depth First Search algorithm to traverse a graph of “n” vertices and “e” edges is:

1.6 The time complexity of the Depth First Search algorithm to traverse a graph of “n” vertices and “e” edges is:
A) O (n) if the graph is represented by adjacency matrix.
B) O (n) if the graph is represented by adjacency list.
C) O (e) if the graph is represented by adjacency list.
D) None of the above


Leave a Reply