Recover Binary Search Tree Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. 互换二叉搜索树中两个位置错误的节点. 思路: 预设三个指针pre,p1,p2.p1用来指向第一个出错的节点,p2用来指向第二个出错的节点. 出错情况有两种,即p1和p2相邻,p1和p2不相邻. 中序遍历此二叉树,用…