On Recursion and Trampoliningby@heypran
1,816 reads

On Recursion and Trampolining

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

In recursion a function calls itself without finishing its own execution. This creates a stack of unfinished function calls and due to memory constraints there can only be a certain limit of function calls allowed in a stack. A tail call is when a recursion call only happens at the end of the function in a return statement. In a trampolined recursion, we call a function that in turn returns a function ( not a function call) and this returned function again calls our recursion function.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - On Recursion and Trampolining
Pran B. HackerNoon profile picture

@heypran

Pran B.


Receive Stories from @heypran

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa