Algorithmic Thinking Cover

Algorithmic Thinking: A Problem-Based Introduction

by Daniel Zingaro
November 2020, 408 pp.
Use coupon code PREORDER to get 25% off!

Download Chapter 1: HASH TABLES

Supplementary resources for the book, including downloadable code and additional exercises available here.

Programming is about using a computer to solve problems, and algorithms and data structures are the building blocks of computer programs. For each problem that a programmer wants to solve, they employ an algorithm: a sequence of steps for solving the problem. Many books teach algorithms independently of specific problems, but this book uses careful explanations, examples, and arguments, rather than formal mathematics and proofs which make it difficult for you to connect what you are learning to what you can do with that learning. Algorithmic Thinking: A Problem-Based Introduction teaches you to use the best algorithms and data structures for a given situation by walking you through solving problems pulled from international programming competitions, such as how to determine whether snowflakes are unique; how to win a game in the minimum number of moves; how to find the number of ways to get to someone's house; how to escape a cave in as few steps as possible; and so on.

You'll tackle challenging topics like recursion, dynamic programming, graphs, greedy algorithms, heaps, hash tables, segment trees, and other data structures for efficiently handling data. The book contains no pseudocode: all code is written in C and is thoroughly explained in the text (C is a de facto programming language for programming competitions). By the end of the book, you should understand the importance of carefully working through a problem, and why it pays to organize data using data structures.

Author Bio 

Dr. Daniel Zingaro is an assistant teaching professor of computer science and award-winning teacher at the University of Toronto. His main area of research is computer science education research, where he studies how students learn (and sometimes don't learn) computer science material.

Table of contents 


Chapter 1: Hash Tables
Chapter 2: Trees and Recursion
Chapter 3: Memoization and Dynamic Programming
Chapter 4: Graphs and Breadth-First Search

Chapter 5: Shortest Paths in Weighted Graphs
Chapter 6: Binary Search
Chapter 7: Heaps and Segment Trees
Chapter 8: Union-Find
Appendix A: Algorithm Runtime
Appendix B: Because I Can’t Resist
Appendix C: Problem Credits

The chapters in red are included in this Early Access PDF.

View the detailed Table of Contents


"A good choice for anyone who needs to understand and implement algorithms." RedGreenCode

“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