What is the time complexity of Depth-First Search (DFS) on an undirected, connected graph in terms of the number of vertices (V)?
O(E)
O(V^2)
O(V)
O(E log V)

Data Structures and Algorithms Exercises are loading ...