Tree
98. Validate Binary Search Tree
The trap is thinking a local check — left < node < right at each node — is enough. It isn't: a node deep in the right subtree still has to exceed the root, not just its parent. So carry a valid open…
Loading…
The trap is thinking a local check — left < node < right at each node — is enough. It isn't: a node deep in the right subtree still has to exceed the root, not just its parent. So carry a valid open…
Loading…