You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: