CHAPTER 8
Counting Problems
Music is the pleasure the human mind experiences from counting without being aware that it is counting.
—Gottfried Leibniz
RECURSION is used extensively in combinatorics, which is a subfield of mathematics that studies counting, and plays an important role in advanced algorithm analysis. This chapter focuses on recursive solutions to computational counting problems, whose goal consists of adding up a certain number of elements, entities, choices, concepts, etc. A common strategy consists of grouping the items to be counted into several disjoint subsets, and adding the number of elements in each one. In terms of recursion, an original problem will be decomposed into several subproblems, and the result will be the ...
Get Introduction to Recursive Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.