Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document difference between depth-first search for graphs O(v + e) and for binary trees O(v) #6

Open
enriquedlh97 opened this issue Apr 24, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation important Refers to a very important issue that should be fixed

Comments

@enriquedlh97
Copy link
Owner

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.

@enriquedlh97 enriquedlh97 added documentation Improvements or additions to documentation important Refers to a very important issue that should be fixed labels Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation important Refers to a very important issue that should be fixed
Projects
None yet
Development

No branches or pull requests

1 participant