1.什么是Binary Search Tree?
可以看下这篇文章: 《Binary Search Tree 二叉搜索树 C++》 。二叉搜索树的左节点比根节点要小,右节点比根节点要大。这样利于搜索。
一个典型的二叉搜索树如下:
2.Recover Binary Search Tree 这题目是什么意思?
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?