15 Designing solutions with recursion and backtracking

This chapter covers

  • Recursion for designing solutions to programming problems
  • Dynamic backtracking to try different solution paths during run time

Recursion is a software design technique used to create solutions to certain programming problems. It involves a function that calls itself, and nearly all modern programming languages support this important technique. If we use recursion properly with certain classes of programming problems, we can design solutions that are simple, elegant, and as some might claim, magical. With recursion, we can design solutions that may be difficult to solve otherwise.

Recursion requires a different way of thinking about how to design a programming solution ...

Get Object-Oriented Software Design in C++ 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.