New answers tagged

-1 votes

Runtime complexity of permutation function

Consider this piece of code: for i in range(len(nums)): dfs(nums[:i]+nums[i+1:], curr+[nums[i]], res) Note that ...
user avatar
  • 791
0 votes

What is the correct complexity of All paths from Source to Target DFS solution?

For directed graph :- Suppose there are 7 vertices {0,1,2,3,4,5,6} and consider the worst case where every vertex is connected to every other vertex => No of edges required to reach from x to y ...
user avatar
2 votes

Confuse on proof of theorem 22.9 (White-path theorem) Depth-First search (DFS) on Cormen-Leiserson-Rivest-Stein "Introduction to algorithms" book

I'm not sure what the problem is, but I will still try to answer. The predecessor of $v$ in a path from $u$ to $v$ is the last vertex seen before $v$. Since there exists a path from $u$ to $v$ then, ...
user avatar
  • 7,105

Top 50 recent answers are included