The other cases recurse toward the base case. This way, the calculation can stop.
e.g. you know the Fibonacci number of 0 and 1. Every other is the sum of the two predecessors. So fib(3) is fib(2)+fib(1); whith fib(2) being fib(1)+fib(0) and fib(1) and fib(0) being known --> the "base case(s)".
56
u/TheHackPete Jun 16 '21 edited Jun 16 '21
(The) One case you know the answer for.
The other cases recurse toward the base case. This way, the calculation can stop.
e.g. you know the Fibonacci number of 0 and 1. Every other is the sum of the two predecessors. So
fib(3)isfib(2)+fib(1); whithfib(2)beingfib(1)+fib(0)andfib(1)andfib(0)being known --> the "base case(s)".