leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

[Recover Binary Search Tree] Any idea for a constant space solution?

Open TrigoTao opened this issue 10 years ago • 0 comments

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?

TrigoTao avatar Jan 03 '15 07:01 TrigoTao