© Giulio Zambon 2016

Giulio Zambon, Practical C, 10.1007/978-1-4842-1769-6_3

3. Iteration, Recursion, and Binary Trees

Giulio Zambon

(1)Harrison, Aust Capital Terr, Australia

Iteration and recursion are strategies to solve complex problems by repeatedly performing simpler operations. But while iteration involves repeating the same operation in a loop, recursion means partially solving increasingly simpler cases of the problem until you reach base cases for which you already have a solution.

In this chapter you will first learn the difference between iteration, which means repeating the same sequence of steps, and recursion, in which each steps contains further instances of themselves like Matryoshka dolls. This will give you the tools to understand ...

Get Practical 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.