+ 6
Base case is the case for which we know the answer for. The base case in a recursive algorithm is the case that is no longer recursive. For example, here’s a recursive algorithm to compute n! (n factorial): If n = 1, the answer is 1 Otherwise, the answer is n(n−1)! In this case we know we need to return 1 if the n=1 hence it is the base case.
28th Apr 2018, 5:29 AM
Rusty.Metal