recursion
Recursion
What is Recursion?
包含兩個部分
1. Base Case: 終止條件
A base case (or cases) defined, which defines when the recursion is stopped - otherwise it will go on forever!
2. Recursive Case: 遞迴條件
A recursive case, which calls the function itself with a modified input, moving it closer to the base case.
Example
1 |
|
recursion
https://shengshengyang.github.io/2024/11/03/recursion/