[Algorithm]-The core idea of recursion

The first element: be clear what you want this function to do

The second element: find the recursive end condition

The third element: find out the equivalent relation of the function

Case study

1. Fibonacci sequence

f(n) = f(n-1) + f(n-2)

Guess you like

Origin blog.csdn.net/dong8633950/article/details/115319538