On Recursion and Trampolining

Written by heypran | Published 2020/09/05
Tech Story Tags: javascript | software-development | programming | algorithms | reactjs | web-development | nodejs | typescript | web-monetization

TLDR 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.via the TL;DR App

no story

Written by heypran | Curiosity killed the Schrodinger's cat? or did it?
Published by HackerNoon on 2020/09/05