Problem Link:
https://oj.leetcode.com/problems/recover-binary-search-tree/
We know that the inorder traversal of a binary search tree should be a sorted array. Therefore, we can compare each node w...
题目链接:Recover Binary Search Tree | LeetCode OJ
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) sp...
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Example 1:
Input: [1,3,null,null,2]
1
/
3
\
...