July 2021
Beginner to intermediate
661 pages
15h 15m
English
In this chapter, we consider an immensely powerful technique for solving problems: recursion. Recursion involves recognizing that a problem really consists of the same kind of problem, just on a smaller scale. For example, to sort n elements, we can first find the smallest, then sort all the others, and put them after the smallest. This is, in its essence, what selection sort does; we just didn’t explain it in these terms. When we do describe the algorithm like this, the recursive part is that we sort all but the smallest ...
Read now
Unlock full access