Back to problems

Validate Binary Search Tree

Algorithm · Bloomberg · Medium

Examples Example 1 Example 2 Requirements Given a binary tree's root node, report whether the tree obeys binary search tree (BST) ordering. For each node, every key beneath its left child must be strictly smaller than that node's key, every key in its right-side subtree must be strictly larger, and each of those subtrees must also meet the BST condition. Function signature: Follow-ups: Contrast recursive propagation of (min, max) limits with an in-order traversal, where…

Checking your access…