Re:Data structures and algorithms I actually used while work...
by crimsonaluca20 on Wednesday July 15, 2020 @10:24AM
(#23845594)
For the code above memory complexity is still O(N) even in a language that optimizes for tail calls. This occurs because you have an additional expression that occurs AFTER your recursive call that means the system must hold everything on the call stack for it to work.
Additionally you have a spelling error on line 5.