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.
Amazon • Pending
Hackerrank • Pending
Hackerrank • Pending
Hackerrank • Pending
AMAZON ML SUMMER SCHOOL • Pending