Module 8 · Recursion
The Call Stack, Frame by Frame
Free with an accountReading
Kenji shows Amara a short recursive function and bets she cannot say what it prints. Bob answers first: the deepest call sets square last, so every line must say 1.
Sign in to read
This lesson is free, with an account
An account costs nothing and opens every lesson in this track that is not marked Pro, on every device you read on.
What is inside The Call Stack, Frame by Frame
- One call, one stack frame
- Push and pop: the stack grows with every call
- Amara's paper trace: one row per call
- The return address, honestly
- Read the frames in GCC's own listing
- At -O2 the recursion is gone
- The stack has a limit: measure it
- Why a judged problem states an input limit