Overview - Validate if Tree is BST
What is it?
Given a binary tree, determine whether it is a valid Binary Search Tree (BST). A BST requires: (1) every node in the left subtree has a value strictly less than the node's value, and (2) every node in the right subtree has a value strictly greater than the node's value. Both conditions must hold for every node, not just immediate children.
Why it matters
BST validation is a fundamental interview problem that tests understanding of recursive tree reasoning and the propagation of constraints down subtrees. The key insight — that constraints from ancestors must be passed down — is a pattern used in tree DP, segment tree lazy propagation, and constraint propagation algorithms.
Where it fits
You need comfort with Rust's recursive tree representation using Option> and recursive pattern matching before tackling this. After mastering it, BST insert/delete/search, kth smallest in BST, and inorder successor follow naturally.
