Question: What is the time complexity of the depth-first search (DFS) algorithm in a graph?
Options:
Correct Answer: O(V + E)
Solution:
DFS also explores all vertices (V) and edges (E), resulting in a time complexity of O(V + E).