
Recursion
Limiting Condition
Recursion must have an endpoint to prevent infinite loops.

The recursion stops when the function reaches zero.
Programming Errors
Misusing recursion can cause stack overflow, crashing the program.

He forgot the base case, and the recursion caused a stack overflow.
Efficiency Matters
Recursion can be less efficient and slower than iteration in some cases.

To improve speed, he replaced recursion with a loop.
Compare with
IterateLoopRecurrenceRedundancyReflectionRepetition
WordUp Chrome Extension
As you browse the web instantly look up words you don’t know.
Get Chrome Extension