Two nodes of a binary search tree (BST) have been swapped by mistake, so the tree no longer satisfies the BST property. Given the root of the tree, find the two incorrectly placed nodes (return their…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.