What Happens When You Call a Function?

Written by silver.io | Published 2020/04/13
Tech Story Tags: hacking | algorithm | software-engineering | technology | beginners | tutorial | software-development | coding

TLDR Python Tutor (can handle many other languages) is also a great resource for visualizing how the call stack changes. The parameters for p_sum() are pushed on to the stack in the reverse order they are listed in the argument list. The same process is repeated (with updated values) until the base case is reached and frames begin popping off the stack. This should give you a stronger handle on recursion and make it easier to understand recursion. The call stack is now empty and the stack frame is empty.via the TL;DR App

no story

Written by silver.io | Engineering, hacking, surfing
Published by HackerNoon on 2020/04/13