Two elements of a Binary Search Tree (BST), represented by root A are swapped by mistake. Tell us the 2 values, when swapped, will restore the Binary Search Tree (BST). A solution using O(n) space is pretty straightforward. Could you devise a constant space solution? Note: The 2 values must be returned in ascending order
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.
Future First • Pending
ARM • Pending
ARM • Pending
Adobe • Pending
Adobe Hackthon 2026 Discussion • Pending