Determine if a binary tree is a valid BST. A common mistake: just checking left < root < right is NOT enough!
The correct approach: each node must be within a valid range:
min_val and max_val bounds down recursivelyAlternative: do an inorder traversal and check if the output is strictly increasing. If it is, it's a valid BST!
is_valid_bst(t1)
True
is_valid_bst(t2)
False