DFS visits each vertex and edge once, leading to a time complexity of O(V + E), where V is vertices and E is edges.