Is recursion in-place algorithm?


  • 3
    E

    I saw most solutions here use recursion. But I'm not sure recursion is a in-place algorithm or not. Because recursion maintains call stacks while it's running.


  • 0
    K

    There are instances where a call stack is not maintained, if the recursion is made as the last operation of the algorithm. This is referred as tail-recursion


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.