Exercise 1: Hand-Tracing Factorial(4) — Possible Solution ==================================================================== THE FULL CALL CHAIN, DOWN TO THE BASE CASE ------------------------------ Factorial(4): n is not 0, so call Factorial(3) first Factorial(3): n is not 0, so call Factorial(2) first Factorial(2): n is not 0, so call Factorial(1) first Factorial(1): n is not 0, so call Factorial(0) first Factorial(0): n = 0, BASE CASE, return 1 EVERY MULTIPLICATION AS THE RESULTS COMBINE BACK UP ------------------------------ Factorial(0) returns 1 Factorial(1) returns 1 * 1 = 1 Factorial(2) returns 2 * 1 = 2 Factorial(3) returns 3 * 2 = 6 Factorial(4) returns 4 * 6 = 24 FINAL ANSWER: 24 WHY THIS MATCHES 4! CALCULATED THE ORDINARY WAY ------------------------------ 4! = 4 * 3 * 2 * 1 = 24, confirming the recursive result. The recursive version arrives at the same multiplication, just built up from the smallest factor outward (starting at the base case, 0! = 1, then multiplying in 1, then 2, then 3, then 4) rather than the more familiar top-down order. WHY THIS WORKS AS AN ANSWER ------------------------------ The trace shows every single recursive call made, all the way down to the base case, and every multiplication performed as each call's result returns back up to its caller - following this chapter's own worked Factorial(5) trace structure exactly, one level shallower.