Update: Jeremy Kubica's third book of humorous explanations of computer science, The CS Detective, is now available!
Computational Fairy Tales includes over 70 stories that are written for a variety of audiences, from someone with absolutely no programming experience to people with significant computer science backgrounds. Below is an attempt to categorize the stories by level. Feedback and suggestions welcome. And, of course, all stories are suitable for people that have a significant programming background and happen to like the stories.
Also see the Stories by Topic.
Beginner: Focuses on general concepts (e.g., very high level algorithms) and simple programming concepts. Good for people without significant (or any) programming experience, including both: people just learning to program and people with no interest in programming but who want to know the concepts.
- Basic Programming:
- Loops and Making Horseshoes (Loops)
- The Marvelous IF-ELSE Life of the King's Turtle (IF-ELSE)
- While Loops and Dizziness (Loops)
- Singing with Loops (Loops)
- Learning IF-ELSE the Hard Way (IF-ELSE)
- Switch/Case and the Palace Guards (Switch/Case)
- Functions and Sailing (Functions)
- Variables, IF Statements, and Magic Boots (Variables)
- Basic Algorithms / Data Structures:
- The Ant and the Grasshopper: A Fable of Algorithms (Algorithms)
- Bullies, Bubble Sort, and Soccer Tickets (Bubble Sort)
- Hunting Dragons with Binary Search (Binary Search)
- Binary Searching for Cinderella (Binary Search)
- Arrays, Linked Lists, and Zed's Coffee Shop (Arrays, Linked Lists)
- Swapping Array Values and the Swimmy Friends Pet Store (Arrays)
- Boolean Logic:
- Unhappy Magic Flowers and Binary (Binary)
- Using Binary to Warn of Snow Beasts (Binary)
- Encodings for Tic-Tac-Toe (Encodings)
- High level CS concepts:
- The Tortoise, the Hare, and 50000 Ants (Parallel Algorithms)
- Programming Languages, Compilers, and Pigeons (Programming languages, Compilers)
- Caching and the Library of Alexandria (How caches work)
- Computer Memory and Making Dinner (Computer memory hierarchy)
- Pixels, Peacocks, and the Governor's Turtle Fountain (pixels)
- The Importance of Design in Five Course Meals (software design)
Intermediate: Algorithms, data structures, and practical programming techniques. Concepts generally covered the second half of an introductory CS course and in an intro to algorithms course. Good for people who have some experience programming.
- Data Structures:
- Linked Lists, Kindergarten, and Ocean Voyages (Linked Lists)
- Stacks, Queues, Priority Queues, and the Prince's Complaint Line (Stacks, Queues, Priority Queues)
- Amoebas Have Boring Family Trees (Trees)
- Binary Search Trees and Speck the Spider (Binary Search Trees)
- President of the Heap (Heaps)
- Choose Your Own Adventure Stories Are Not Linked Lists (Linked Lists)
- Ushers, Peanut Vendors, and Matrix Indices (Matrices)
- A Disagreement Over Data Structures (Graphs)
- Algorithms:
- Why Tailors Use Insertion Sort (Insertion Sort)
- Merge Sort and Lines of Kindergarteners (Merge Sort)
- Sorting During the Flu Outbreak: The Reality of Sorting Small Data Sets (Sorting)
- Breadth First Search and the Pig Thief (Breadth First Search)
- Panicked Depth First Search (Depth First Search)
- Graphs:
- The City of G'Raph
- Directed Graphs, Bridges, and the Mayor's Office
- Bridge Weights
- Connected Components and the Birthday Sign
- Strings:
- Object Oriented Programming:
- Objects, Encapsulation, and Cheese Factories
- Classes of Cheese
- Inheritance in Cheeses and Magic Spells
- Classes, Inheritance, and the Three Little Pigs
- Practical programming:
- The Importance of (Variable) Names (variable names)
- Names for Ingredients (and Variables) (variable names)
- The Importance of Unit Testing Magic Spells (Unit tests)
- The Incident at the North Gate (or why = is not ==) (= and ==)
- Variable Initialization in Busy Kitchens (Variable Initialization)
- The Importance of Good Comments: A Tale of the Baker's Apprentice (Comments)
- The Curse of Excessive Commenting (Comments)
- Integer Overflow and 00000 Customers Served (Overflow)
- Enums and Hair Colors (Enums)
Advanced: Advanced algorithms, pointers, and computational theory. These are topics more commonly found in algorithms courses. Good for people who have been programming for a while or have taken some computer science courses.
- Pointers and Memory:
- Pointers and Walk-In Closets (Introduction to Pointers)
- Malloc, Free and the Mall of New Athens (Pointers, Memory Management)
- Computational Complexity / Big-O Notation:
- Algorithms:
- Dijkstra's Algorithm on Scooters (Dijkstra's Algorithm)
- Minimum Spanning Trees, Prim's Algorithm, and Bridge Upgrades (Prim's Algorithm)
- Minimax Search and the Oracle of Old Toronto (Minimax)
- NP-Hard Problems:
- Packets, Supply Chains, and the Road to Alexandria (Packets)
- Checkpointing Checkers (Checkpoints)
- Bog Dragons Do Not Support Multithreading (Multi-threading)
- Practical Programming:
- Data Validation, Marcus, and the Minstrel of Cheese (Data Validation)
- Version Control in Magic Spell Development (Version Control Systems)
- The Fairy's Sandbox (Sandboxes)
Really? Completely random topics. The target audience here is people who have been studying computer science for a while.
- Const and Library Books (Const)
- Noop: The Man Who Stood in Line (No-op)
- Fun with Boolean Statements (Boolean Simplification)
- Recursion, Overhead, and Computational Graffiti (Recursion)