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

Add more efficient solution to lowest common ancestor #9

Open
idf opened this issue Dec 12, 2018 · 1 comment
Open

Add more efficient solution to lowest common ancestor #9

idf opened this issue Dec 12, 2018 · 1 comment

Comments

@idf
Copy link
Member

idf commented Dec 12, 2018

Location: Binary tree page 10. Current solution is inefficient. Need to add more efficient algorithm.

@idf
Copy link
Member Author

idf commented Dec 12, 2018

Similar to https://www.geeksforgeeks.org/lowest-common-ancestor-binary-tree-set-1/ but the explanation of it is weak. But it returns is not direct LCA - what the recursive function returns is actually the subtree root that containing the at least one of the nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant