What Happens When You Call a Function?by@silver.io
425 reads
425 reads

What Happens When You Call a Function?

by silver.io1mApril 13th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.
featured image - What Happens When You Call a Function?
silver.io HackerNoon profile picture
silver.io

silver.io

@silver.io

Engineering, hacking, surfing

About @silver.io
LEARN MORE ABOUT @SILVER.IO'S
EXPERTISE AND PLACE ON THE INTERNET.

Share Your Thoughts

About Author

silver.io HackerNoon profile picture
silver.io@silver.io
Engineering, hacking, surfing

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!