Grokking Algorithms: An Illustrated Guide for Programmers and Other Curious People 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Frequently bought together
From the Publisher
About this Book
This book is designed to be easy to follow. I avoid big leaps of thought. Any time a new concept is introduced, I explain it right away or tell you when I’ll explain it. Core concepts are reinforced with exercises and multiple explanations so that you can check your assumptions and make sure you’re following along.
I lead with examples. Instead of writing symbol soup, my goal is to make it easy for you to visualize these concepts. I also think we learn best by being able to recall something we already know, and examples make recall easier. So when you’re trying to remember the difference between arrays and linked lists (explained in chapter 2), you can just think about getting seated for a movie. Also, at the risk of stating the obvious, I’m a visual learner. This book is chock-full of images.
The contents of the book are carefully curated. There’s no need to write a book that covers every sorting algorithm—that’s why we have Wikipedia and Khan Academy. All the algorithms I’ve included are practical. I’ve found them useful in my job as a software engineer, and they provide a good foundation for more complex topics. Happy reading!
This book is aimed at anyone who knows the basics of coding and wants to understand algorithms. Maybe you already have a coding problem and are trying to find an algorithmic solution. Or maybe you want to understand what algorithms are useful for.
Who Should Read This Book
- Hobbyist coders
- Coding boot camp students
- Computer science grads looking for a refresher
- Physics/math/other grads who are interested in programming
About the Author
- Publisher : Manning Publications; 1st edition (May 1, 2016)
- Language : English
- Paperback : 256 pages
- ISBN-10 : 1617292230
- ISBN-13 : 978-1617292231
- Item Weight : 15.8 ounces
- Dimensions : 7.38 x 0.4 x 9.25 inches
- Best Sellers Rank: #20,955 in Books (See Top 100 in Books)
- Customer Reviews:
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
However, once I actually did get the time to read this book cover to cover, I was immensely disappointed. The three stars given are primarily because the book starts off very strong; the coverage of binary search and the intro to Big-O provides precisely what was promised. Yet, these are only about the first 20 pages. After this beginning, the book becomes somewhat erratic, I cannot for the life of me understand why more of the sorting algorithms were not covered. The only sorts covered are quicksort and selection sort. There is a section titled 'Mergesort vs Quicksort' in which merge sort is only mentioned, not described or explained at all, and this is only a single paragraph; insertion sort gets only a sentence.
The book's treatment of recursion is fantastic, but gets at my worst frustration with this book: the author discusses and thoroughly describes basic recursion, providing excellent illustrations of the call stack during execution and tracing the entire execution of a recursive function. At the end of this exercise, he mentions tail recursion (a critical aspect of recursion that more than merited the explanation, which would not have taken much more considering he’d already explained the call stack) and says it's beyond the scope of the book. However, the second half of the book is then dedicated to advanced topics like K-nearest neighbors (solid explanation) and just mentioning things that one would end up studying elsewhere on one's own. A whole chapter is dedicated to Dijkstra's Algorithm (again, solid coverage), which is a somewhat advanced algorithm that benefits from his illustrations and descriptions, but leaves to question, who made the decision to leave out a more complete description of recursion and thorough coverage of searches and sorts in lieu of what at the end seems like filler chapters? Anyone who is at the point of needing to understand those two algorithms likely won't read an illustrated book on the topic; to me, these topics supplant those someone intrigued by the idea of this book might've come seeking.
There are errors, but they're no biggie. The very first piece of code in the book contains an omission that causes it to malfunction (setting of the variable 'mid' should divide the sum of 'high' and 'low' by 2). I came to realize it may have been due to a page layout or typesetting issue as I found the same problem in several chapters. It seems the edges of the code are partially covered by images. The coverage of Big-O beyond the intro chapter is a little weak, and only helped because I had some previous knowledge of the concepts surrounding it, and the fact that much of the explanation is repeated several times, so some bits finally sink in. I could see how someone coming to this book hoping to have 'aha' moments about algorithms would be left very lost.
The author also uses the technique of describing how something works in a simple way and then a section later taking it all back and saying 'this is really how it works'. I've seen this before, and it can be effective, but a writer must take care the manner in which he simplifies the initial example. This happens rather confusingly in the explanation of hash tables (associative arrays) in relation to their performance. If you're following his description of them, its clear that him saying they return values 'instantly' is somewhat odd particularly when you understand what O(1) actually means. When he follows up to clarify, which he does by describing how hash tables can be slow in some cases, the clarification isn't really satisfying as you didn't really absorb the chapter wondering if perhaps you missed something before since hash tables were glowingly described as the data structure to end all data structures. He then goes into discussing (incompletely) the implementation of hash tables, which he keeps saying 'you'll never have to do'. He then trails off with a brief description of things to consider when using them without really implementing a hash table in code as suggested (examples 'using' hash tables are given, but the mention of 'implementing' them comes after this and indicates an upcoming example which never materializes).
I wrote this review only as a warning. The implementation of the book is a solid 2 stars considering the price; the first half gets it to 3. The book is about 50% as described, 50% the author seemingly trying to prove he has a CS degree. Perhaps friends told him the book was too simplistic. Unfortunate. The heavy appearance of 5 star reviews here greatly misled me. Reading them afterward, it seems most are praising the idea of the book and not its actual execution. Had I read it during the return period, I would have returned it. I am a intermediate-level programmer. I understood most of these topics at a basic level beforehand. I ordered this book because I had been recommending it to others, who wanted to learn about algorithms from scratch, as the premise of it sounded excellent. I finally decided to read it myself since I've been raving about it for the last year; I wish I had read it first. It's a fun read, but don't expect any epiphanies. If you're a beginner, you're actually better off searching "basic sorting/searching algorithms" online and learning from YouTube videos until you can grasp the content of a college textbook (or one of the programming interview prep books which cover algorithms very thoroughly without the math of a university text). This book starts off great, but finishes more like a set of blog posts written over the course of a year, by a person who couldn't wait to prove to you how smart he was becoming day by day. I know many times a project can start off as one thing, and then after input by many people and via your own desires to do something great, lose its way; it seems that may have happened here with the author deciding that the basic algorithms were too mundane, and choosing to try and explain more impressive concepts which somewhat ironically, are ‘beyond the scope of this book’.
This book was incredible for me. Buy it if you've trudged through algorithms courses before and feel like you barely gleaned anything.
I'd say probably start here if you're totally new to the topic, and/or only want some bare-bones laymen's explanations.
After this, look at Jay Wengrow's "Common Sense Guide to Data Structures and Algorithms" from Pragmatic Programmers, which is similar to this book, but walks through its examples and implementations in (a little) more depth.
Top reviews from other countries
Let's get something straight: algorithms can be hard, and when you get down to the nitty gritty the source material is drier than a particularly dry thing at midday in the Sahara so anything that attempts to make the concepts more palatable to the self-taught is to be applauded irrespective of whether or not it succeeds. The thought of an illustrated book will, no doubt, make the purists recoil in horror - that's their loss. Sometimes a couple of drawings are far more illuminating than pages full of discrete mathematics, and this is what we have here.
This won't be to everyone's tastes - some programming knowledge is assumed, but the fundamentals are discussed in a fluff-free manner with short snippets of code (in Python) to reinforce the points made. The usual suspects are here: starting with binary search, moving up through various sorting and tree/graph algorithms with a brief detour into NP-complete problems such as the travelling salesman and knapsack problem. There's an excellent overview of big-O notation and one of the better explanations of recursion that I've come across - I almost feel that I understand it now.
If your background is in 'hard' computer science then there's probably very little here for you - having said that, if you're self-taught or have moved into software development from another discipline then you'll probably learn something. Certainly, I found even the basic stuff to be very illuminating and have started applying some of the concepts to my own code with tangible results.
TL;DR - if you've already got a grounding in computer science then look elsewhere- there are plenty of other books on algorithms and algorithmic design that will go into excruciating amounts of detail. If you're not one of these people and want to get up to speed then this may be right up your street - the content is engaging enough that it'll encourage you to read more deeply into the subject.
Several concepts that aren’t algorithms per se are also explained, for example arrays, linked lists, hash maps and call stacks. The book covers a broad range of algorithms, from basic ones, like binary search and sorting, to more advanced like graph algorithms and dynamic programming.
The implementations are given in Python. However, the emphasis is not on the code, but on explaining how the algorithms work. The true test to see if you have understood the content is to write your own implementations of the algorithms. Reading this book is a good first step to that understanding.
This book is specifically geared towards the visual learner. We want to "see" where we're going, and this book gives you more in the first chapter than an entire year of University education.
If you're a visual learner, this book is unique and a must have.
There is nothing else on the market that has this approach. You can "see" the point, the logic and how it works, and that's it. You've learnt a "hard concept" and are grinning from ear to ear, as it's taken you 10 minutes.
Another bonus is that the publisher provides the means to download the ebook versions (kindle, pdf, etc.) free of charge with the purchase of the paper book.