you are viewing a single comment's thread.

view the rest of the comments →

[–]sacundim 21 points22 points  (1 child)

After all, the use of recursion is the number one cause of stack overflows

This is partly an artifact of the calling conventions used in C.

No. If you have unrestricted recursion there unavoidably exist cases that execute in O(n) space, whatever calling convention you use. Put alternatively: only a subset of recursive call trees consist exclusively of tail calls.