Learn how and when to use the right data structures in any situation, strengthening your computational thinking, problem-solving, and programming skills in the process.

This accessible and entertaining book provides an in-depth introduction to computational thinking through the lens of data structures — a critical component in any programming endeavor. You’ll learn how to work with more than 15 key data structures, from stacks, queues, and caches to bloom filters, skip lists, and graphs. You’ll also master linked lists by virtually standing in line at a cafe, hash tables by cataloging the history of the summer Olympics, and Quadtrees by neatly organizing your kitchen cabinets, all while becoming familiar with basic computer science concepts, like recursion and running time analysis.
Introduction
Chapter 1: Information in Memory
Chapter 2: Binary Search
Chapter 3: Dynamic Data Structures
Chapter 4: Stacks and Queues
Chapter 5: Binary Search Trees
Chapter 6: Tries and Adapting Data Structures
Chapter 7: Priority Queues and Heaps
Chapter 8: Grids
Chapter 9: Spatial Trees
Chapter 10: Hash Tables
Chapter 11: Caches
Chapter 12: B-Trees
Chapter 13: Bloom Filters
Chapter 14: Skip Lists
Chapter 15: Graphs
Conclusion
Jeremy Kubica is an engineer director specializing in artificial intelligence and machine learning. He received a Ph.D. in Robotics from Carnegie Mellon University and a BS in Computer Science from Cornell University. He spent his graduate school years creating algorithms to detect killer asteroids (actually stopping them was, of course, left as “future work”). He is the author of multiple books designed to introduce people to computer science, including Computational Fairy Tales and The CS Detective, as well as the Computational Fairy Tales Blog.

About

Learn how and when to use the right data structures in any situation, strengthening your computational thinking, problem-solving, and programming skills in the process.

This accessible and entertaining book provides an in-depth introduction to computational thinking through the lens of data structures — a critical component in any programming endeavor. You’ll learn how to work with more than 15 key data structures, from stacks, queues, and caches to bloom filters, skip lists, and graphs. You’ll also master linked lists by virtually standing in line at a cafe, hash tables by cataloging the history of the summer Olympics, and Quadtrees by neatly organizing your kitchen cabinets, all while becoming familiar with basic computer science concepts, like recursion and running time analysis.

Table of Contents

Introduction
Chapter 1: Information in Memory
Chapter 2: Binary Search
Chapter 3: Dynamic Data Structures
Chapter 4: Stacks and Queues
Chapter 5: Binary Search Trees
Chapter 6: Tries and Adapting Data Structures
Chapter 7: Priority Queues and Heaps
Chapter 8: Grids
Chapter 9: Spatial Trees
Chapter 10: Hash Tables
Chapter 11: Caches
Chapter 12: B-Trees
Chapter 13: Bloom Filters
Chapter 14: Skip Lists
Chapter 15: Graphs
Conclusion

Author

Jeremy Kubica is an engineer director specializing in artificial intelligence and machine learning. He received a Ph.D. in Robotics from Carnegie Mellon University and a BS in Computer Science from Cornell University. He spent his graduate school years creating algorithms to detect killer asteroids (actually stopping them was, of course, left as “future work”). He is the author of multiple books designed to introduce people to computer science, including Computational Fairy Tales and The CS Detective, as well as the Computational Fairy Tales Blog.

Three Penguin Random House Authors Win Pulitzer Prizes

On Monday, May 5, three Penguin Random House authors were honored with a Pulitzer Prize. Established in 1917, the Pulitzer Prizes are the most prestigious awards in American letters. To date, PRH has 143 Pulitzer Prize winners, including William Faulkner, Eudora Welty, Josh Steinbeck, Ron Chernow, Anne Applebaum, Colson Whitehead, and many more. Take a look at our 2025 Pulitzer Prize

Read more

Books for LGBTQIA+ Pride Month

In June we celebrate Lesbian, Gay, Bisexual, Transgender, Queer, Intersex, and Asexual + (LGBTQIA+) Pride Month, which honors the 1969 Stonewall riots in Manhattan. Pride Month is a time to both celebrate the accomplishments of those in the LGBTQ+ community and recognize the ongoing struggles faced by many across the world who wish to live

Read more