Properties of recursive algorithms
We'll cover the following...
Here is the basic idea behind recursive algorithms:
To solve a problem, solve a subproblem that is a smaller instance of the same problem, and then use the solution to that smaller instance to solve the original problem.
When computing
In order for a recursive algorithm to work, the smaller subproblems must eventually arrive at the base case. When computing
For example, what if we tried to compute the factorial of a negative number using our recursive method? To compute