Binary tree
What is the lowest common ancestor of 5 and 4 in the binary tree above, considering we allow a node to be a descendant of itself. Wouldn't it be 3? if not, what would it be and why?
Binary tree
What is the lowest common ancestor of 5 and 4 in the binary tree above, considering we allow a node to be a descendant of itself. Wouldn't it be 3? if not, what would it be and why?
Copyright © 2021 Jogjafile Inc.
As we allow a node to be a descendant of itself, LCA will be 5.