Company: Media Net_31oct
Difficulty: medium
Recover Binary Search Tree Problem Description A binary search tree was built correctly, and then exactly two of its node values were swapped with each other by mistake. Every other node still holds the value it should. Given the damaged tree, report the two values that were swapped. Putting those two values back where they belong is what restores the tree to a valid binary search tree, and no other pair of values would do it. Return the two values in increasing order. Input Format One line holding the tree as a level-order array in the usual bracketed form: the root first, then each level left to right, with null marking a missing child. Trailing null entries are omitted. For example [3,1,4,null,null,2] is the tree whose root is 3 , whose left child is 1 and whose right child is 4 , and where 4 has a left child 2 . Output Format One line holding the two swapped values in increasing order, as [smaller, larger] -- square brackets, a comma and one space between the values. Examples Examp