leetcode
leetcode copied to clipboard
[Recover Binary Search Tree] Any idea for a constant space solution?
The code used recursion, the space may be O(n). I searched for the O(1) solutions, and found that they all use morris traversal to satisfy O(1) space complexity. So, the only different thing is how to traverse the tree. But, any better idea?