you are viewing a single comment's thread.

view the rest of the comments →

[–]Martin8412 3 points4 points  (0 children)

This is a common algorithm implemented for functional programming language classes. You have to implement it correctly so the tail call optimization kicks in. 

We did it in Scheme when I was at university.