Binary Search Tree : Lowest Common Ancestor

  • + 0 comments

    I think this is much cleaner apporach by arranging v1 < v2

    It is much easier to understand the logic.

    performance is also slightly better.

    you don't need else.. just two if commands and a return

    if (...) return left_tree_lca

    if (...) return right_tree_lca

    return root

    Great jobs!! :)