Challenges • Asked almost 5 years ago by Devesh Kumar Singh
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.