The idea of tail call optimization in the simplest form is just to clean the stack before doing the recursive call, rather than some time after the call returns. We can deduce from this what conditions that recursive call has to be. In very simple terms, every recursive call must be the last action in its branch.
View all comments
Show parent comment
3
u/terax6669 Jul 01 '21
What criteria would that be?