Recursion: a Call-Stack Table Going Down and Coming Back Up, the Same Task as a Loop and Stack Depth
This lesson is part of the course
In this lesson
You fill the missing return values in two call-stack tables – a product of 1 … n and a digit sum – trace the same product with a loop and count how deep the digit-sum stack grows.
Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.
Lessons in this course
- Variables & Assignment: One Executed Line per Row, a Column per Variable and the Swap with a Temporary Locked
- Conditions: If / Else-If Chains as IFS, AND/OR/NOT and a Test Table that Reaches Every Branch Locked
- Counting Loops: a For-Loop Row by Row, Accumulators, Running Totals and Nested Loops Locked
- While Loops & Termination: Digit Sums with INT and MOD, Halving to a Limit, a Toy 3n + 1 Sequence and an Iteration Guard Locked
- Arrays & Strings: 0-Based vs 1-Based Positions, the Running Maximum, Counting Matches and Reversing a Word Locked
- Functions: Parameters & Return Values, a Call Log and Functions With and Without Side Effects Locked
- Recursion: a Call-Stack Table Going Down and Coming Back Up, the Same Task as a Loop and Stack Depth Locked
- Capstone – Debugging: < vs <= in Loop Bounds, Wrong Start Values, Buggy vs Fixed Traces, a Test Table and a Bug Chart Locked