dsa5 min read
Recover Binary Search Tree — LC 99 In-Order Inversion Trick
Recover a BST where two nodes are swapped using in-order traversal to find the inversion pair. LeetCode 99 is asked at Amazon, Google, and Meta. Includes O(1) space Morris traversal solution.
Read →