Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: moves and plan

โญโญ intermediateโณ 30 min read๐Ÿ“ Lesson 124 of 256

A classic recurrence plus the print-order discipline in one method pair.

moves is the exam's favorite recurrence (2ยทf(nโˆ’1)+1 โ†’ 2โฟโˆ’1); plan is the print-order trap: printing BEFORE the recursive call yields ascending order, printing AFTER yields descending. Students who can produce both on demand โ€” one arithmetic, one structural โ€” own the two halves of every recursion question the exam asks.