Synopses & Reviews
Synopsis
A hands-on, problem-based introduction to building algorithms and data structures to solve problems with a computer. 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 the reader to connect what they are learning to what they can do with that learning. Algorithmic Thinking: A Problem-Based Introduction teaches the reader to use the best algorithms and data structures for a given situation by walking them through solving real-world 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.
Readers 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). Zingaro also shows how several problems can be reduced to algorithms on graphs. By the end of the book, readers should understand the importance of modeling, how to carefully work through a problem, and why it pays to organize data using data structures.
Synopsis
A hands-on, problem-based introduction to building algorithms and data structures to solve problems with a computer. Algorithmic Thinking will teach you how to solve challenging programming problems and design your own algorithms. Daniel Zingaro, a master teacher, draws his examples from world-class programming competitions like USACO and IOI. You'll learn how to classify problems, choose data structures, and identify appropriate algorithms. You'll also learn how your choice of data structure, whether a hash table, heap, or tree, can affect runtime and speed up your algorithms; and how to adopt powerful strategies like recursion, dynamic programming, and binary search to solve challenging problems.
Line-by-line breakdowns of the code will teach you how to use algorithms and data structures like:
- The breadth-first search algorithm to find the optimal way to play a board game or find the best way to translate a book
- Dijkstra's algorithm to determine how many mice can exit a maze or the number of fastest routes between two locations
- The union-find data structure to answer questions about connections in a social network or determine who are friends or enemies
- The heap data structure to determine the amount of money given away in a promotion
- The hash-table data structure to determine whether snowflakes are unique or identify compound words in a dictionary
NOTE: Each problem in this book is available on a programming-judge website. You'll find the site's URL and problem ID in the description. What's better than a free correctness check?