July 2018
Beginner
202 pages
5h 4m
English
Recursion is a really useful tool for algorithm designers. It allows you to solve large problems by solving a smaller occurrence of the same problem. Recursive functions usually have a common structure with the following components:
In the next example, we will pick the binary search problem seen in the previous chapter and change the algorithm to work in a recursive manner. Consider the binary search problem discussed in Chapter 1, Algorithms and Complexities, listed in Snippet 1.7. The implementation is iterative, that is, it ...
Read now
Unlock full access