Chapter 1: Hash Tables
Chapter 2: Trees and Recursion
Chapter 3: Memoization and Dynamic Programming
Chapter 4: Advanced Memoization and Dynamic Programming
Chapter 5: Graphs and Breadth-First Search
Chapter 6: Shortest Paths in Weighted Graphs
Chapter 7: Binary Search
Chapter 8: Heaps and Segment Trees
Chapter 9: Union-Find
Chapter 10: Randomization
Appendix A: Algorithm Runtime
Appendix B: Because I Can’t Resist
Appendix C: Problem Credits
Algorithmic Thinking, 2nd Edition
Are you hitting a wall with data structures and algorithms? Whether you’re a student prepping for coding interviews or an independent learner, this book is your essential guide to efficient problem-solving in programming.
UNLOCK THE POWER OF DATA STRUCTURES & ALGORITHMS:
Learn the intricacies of hash tables, recursion, dynamic programming, trees, graphs, and heaps. Become proficient in choosing and implementing the best solutions for any coding challenge.
REAL-WORLD, COMPETITION-PROVEN CODE EXAMPLES:
The programs and challenges in this book aren’t just theoretical—they’re drawn from real programming competitions. Train with problems that have tested and honed the skills of coders around the world.
Prepare yourself for coding interviews with practice exercises that help you think algorithmically, weigh different solutions, and implement the best choices efficiently.
WRITTEN IN C, USEFUL ACROSS LANGUAGES:
The code examples are written in C and designed for clarity and accessibility to those familiar with languages like C++, Java, or Python. If you need help with the C code, no problem: We’ve got recommended reading, too.
Algorithmic Thinking is the complete package, providing the solid foundation you need to elevate your coding skills to the next level.
"Algorithmic Thinking provides the theoretical background and detailed problem explanations required to stay ahead of our human and robotic competitors."
—Duncan Smith, Senior Software Engineer at Microsoft
"In this newly revised edition, Daniel presents a carefully curated collection of challenging programming problems. By deconstructing the problems alongside clear, practical presentations of algorithms and data structures, Algorithmic Thinking will empower you–whether you're looking to get a leg up on technical interviews, enter the world of competitive programming, or just want to sharpen your skills."
—Josh Lospinoso, Ph.D., author of C++ Crash Course
"As someone who learnt algorithms from similar problems-oriented books in the early 00s, I believe an updated yet beginner-friendly exposition is long overdue. This book provides implementation-friendly introductions to most building blocks of combinatorial algorithms . . . It's by far the quickest way to get hands-on experience with algorithms, and is also a great supplement to more theoretical expositions."
—Richard Peng, Associate Professor at the University of Waterloo’s Cheriton School of Computer Science
"Not only does Algorithmic Thinking guide readers on how to approach tackling problems, but Zingaro also helps them understand why these approaches work. With an engaging selection of problems drawn from programming competitions, the book is an excellent guide and an engaging companion for the readers on their learning journey."
—Sushant Sachdeva, Ph.D., Algorithms Professor at the University of Toronto
"The step-by-step solution explanations are so detailed that it feels like Daniel is directly teaching us, his readers. This Second Edition is a worthy update to an already excellent text. I particularly like the new chapter on the rarely discussed randomized algorithms. I believe Computer Science students will enjoy reading it as I do."
—Dr Steven Halim, Senior Lecturer at National University of Singapore
"The book discusses many interesting problems from programming contests and presents useful techniques that are not often included in algorithm textbooks."
—Antti Laaksonen, University of Helsinki
Reviews for the 1st edition:
"A good choice for anyone who needs to understand and implement algorithms."
“With Zingaro as a tutor by your side, you'll learn, through practice on challenging competition problems, a repeatable process for figuring out and deftly applying the most appropriate algorithmic tools for the job. You'll learn it all from a book that exudes clarity, humor, and just the right dose of Canadian pride. Happy problem-solving!”
—Dr. Tim Roughgarden, Professor of Computer Science at Columbia University
"A clear and engaging text . . . By presenting problems first and their algorithm/data structure solutions later, it shows us exactly why those solutions are useful and how they fit into the big picture. . . . Far too many textbooks present solutions fully-formed with no mention of the dead ends and too-complicated solutions you’d hit along the way. But Algorithmic Thinking takes you from the initial idea to the final breakthrough, setbacks and all. Problem solving is a raw, real journey, and this book captures its spirit perfectly. I highly recommend it."
—Ava Pun, medal winner in the International Olympiad in Informatics Programming Competition
"A good introduction to some important competitive programming techniques."
—Antti LAAKSONEN, Olympiads in Informatics
View the supplementary resources for the book, including downloadable code and additional exercises available.