Problem. Return whether a binary tree is a valid binary search tree (BST): for every node, all values in its left subtree are strictly less than its value, and all values in its right subtree are strictly greater.
2 5
/ \ / \
1 3 True 1 6 False (3 is in 5's right subtree but 3 < 5)
/ \
3 7
The ordering is what makes a BST useful: search, insert and delete follow one root-to-leaf path, O(h) (O(log n) when balanced, lesson 10.6), and an in-order walk lists the values sorted. The trap is that the rule is about whole subtrees, not just children.
ML context. Ordered tree indexes sit under databases, feature stores and the sorted containers in Python libraries; an index whose ordering is violated silently returns wrong lookups, which is exactly what a validator catches. The bound passing in Optimisation B is also how a decision tree routes a sample: each split narrows the feature range a leaf covers (lesson 10.14).