Start a Thread

Subscribe You’re not receiving notifications from this thread.

Lowest Common Ancestor - Python Question

Challenges • Asked over 4 years ago by Devesh Kumar Singh

Devesh Kumar Singh Commented on Dec 23, 2019:

Test case tree2 is not valid. tree2 cannot represent a binary search tree since
tree2 = Node(5)
tree2.left = Node(10)
tree2.right = Node(8)
violates the fact that left child should be smaller than root, but here left child is greater than root since 10 > 5

Link to problem: Lowest Common Ancestor.