Loading topic
set membership tests take expected constant time. Here you will see why DFS on an adjacency list costs O(V + E) time. V is the number of vertices and E i6 min readvisited set stops revisits. The code uses Python dictionaries as adjacency lists, with each vertex mapped to a list of its neighbors.5 min readd[u] and a finish time f[u]. You also need to know the difference be6 min read