Copyright
Brief Table of Contents
Table of Contents
Acknowledgments
About this Book
Chapter Introduction
Why Swift?
What is a classic computer science problem?
What kinds of problems are in this book?
Who is this book for?
Swift versioning and tools
No graphics, no UI code
Chapter 1. Small problems
1.1. The Fibonacci sequence
1.1.1. A first recursive attempt
1.1.2. Utilizing base cases
1.1.3. Memoization to the rescue
1.1.4. Keep it simple, Fibonacci
1.2. Trivial compression
1.3. Unbreakable encryption
1.3.1. Getting the data in order
1.3.2. Encrypting and decrypting
1.4. Calculating pi
1.5. The Towers of Hanoi
1.5.1. Modeling the towers
1.5.2. Solving The Towers of Hanoi
1.6. Real-world applications
1.7. Exercises
Chapter 2. Search problems
2.1. DNA search
2.1.1. Storing DNA
2.1.2. Linear search