您的位置:首页 > 其它

Recover Binary Search Tree

2015-09-08 17:12 225 查看
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?

题意:

题目:恢复二叉排序数

二叉排序树中有两个节点被交换了,要求把树恢复成二叉排序树。

注意:你可以使用常量空间求解吗
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: