Document difference between depth-first search for graphs O(v + e) and for binary trees O(v) #6
Labels
documentation
Improvements or additions to documentation
important
Refers to a very important issue that should be fixed
The problem branch sums which uses depth first search for a binary tree has a time complexity of O(v) where v are the vertices in the tree. Using the same DFS strategy in a graph in the problem depth-first search, the time complexity is O(v + e) where v once again corresponds to the vertices in the graph and e to the edges.
Explain in the documentation fo the solution why the same approach yields different time complexities.
The text was updated successfully, but these errors were encountered: