1

I am learning data structures, i am wondering why not use recursion but morris traversal. Both of them have O(n) time complexity and O(1) extra space.

Abhi38
  • 307
  • 1
  • 2
  • 6
  • 1
    That is only true if you are able to do tail recursion. [This talk](https://youtu.be/YA-nB2wjVcI?t=695) (right before the 12 minute-mark) has a in my opinion very good explanation on the algorithm and what its advantages are – n314159 Feb 09 '20 at 13:06

0 Answers0