previous
|
index
|
next
DFS Run Time
DFS run time is the same as for BFS:
Time to Initialize
+
Time for S Operations
+
Time to Process Adj[u]
=
O(V)
+
O(V)
+
O(E)
=
O(V+E)
The time used by DFS is
linear
in the size of the graph.
previous
|
index
|
next