leetcode_99. Recover Binary Search Tree ? 待解决

来源:互联网 发布:linux bt下载工具 编辑:程序博客网 时间:2024/06/10 13:51

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?

提示:提交代码后,需要用简洁的语言解释一下代码思路~ 谢谢

历史题目和总结见公众号「每日一道算法题」

https://leetcode.com/problems/recover-binary-search-tree/description/

思路