Recover Binary Search Tree Algorithm

In graph theory, an M-ary tree (also known as K-ary or K-manner tree) is a rooted tree in which each node has no more than M children. A binary tree is the special case where M = 2, and a ternary tree is another case with M = 3 that restricts its children to three.

Recover Binary Search Tree source code, pseudocode and analysis