Question: What is the time complexity of a depth-first search (DFS) on a graph with V vertices and E edges?
Options:
Correct Answer: O(V + E)
Solution:
DFS visits each vertex and edge once, leading to a time complexity of O(V + E).