The chapter discusses recursion, a powerful technique for designing algorithms. Section 9.1 uses a puzzle to introduce the recursive way of thinking. The analysis of recursive algorithms requires new techniques, which are explained in Section 9.2. Two recursive sorting algorithms are introduced in Sections 9.3 and 9.4. While recursive algorithms are often very concise and elegant, their efficiency can sometimes be improved by converting them into a nonrecursive form, as explained in Section 9.5.
Thinking Recursively |
Part I: Object-Oriented Programming
Encapsulation
Polymorphism
Inheritance
Part II: Linear Structures
Stacks and Queues
Array-Based Structures
Linked Structures
Part III: Algorithms
Analysis of Algorithms
Searching and Sorting
Recursion
Part IV: Trees and Sets
Trees
Sets
Part V: Advanced Topics
Advanced Linear Structures
Strings
Advanced Trees
Graphs
Memory Management
Out to the Disk
Part VI: Appendices
A. Review of Java
B. Unified Modeling Language
C. Summation Formulae
D. Further Reading
Index