WordUpWordup

Recursion

usgb/rɪˈkɜːrʒn/Volume
Left Definition 1 of 3Right
LampPro Tip 1/3
Limiting ConditionPlay
Recursion must have an endpoint to prevent infinite loops. SlideThe recursion stops when the function reaches zero.
LampPro Tip 2/3
Programming ErrorsPlay
Misusing recursion can cause stack overflow, crashing the program. SlideHe forgot the base case, and the recursion caused a stack overflow.
LampPro Tip 3/3
Efficiency MattersPlay
Recursion can be less efficient and slower than iteration in some cases. SlideTo improve speed, he replaced recursion with a loop.