C++ Tail Recursion Using 64-bit variables—Giovanni Campo

Save to:
Instapaper Pocket Readability

Leveraging the elegance of recursion:

C++ Tail Recursion Using 64-bit variables

by Giovanni Campo

From the article:

Main disadvantage of Recursion in imperative languages is the fact that not always is possible to have tail calls, which means an allocation of the function address (and relative variables, like structs for instance) onto the stack at each call. For deep recursive function this can cause a stack-overflow exception because of a limit to the maximum size of the stack, which is typically less than the size of RAM by quite a few orders of magnitude.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.