- Paperback: 300 pages
- Publisher: Manning Publications; 1 edition (31 December 2015)
- Language: English
- ISBN-10: 1617292230
- ISBN-13: 978-1617292231
- Product Dimensions: 19 x 1.3 x 23.5 cm
- Average Customer Review: 3 customer reviews
- Amazon Bestsellers Rank: #1,23,183 in Books (See Top 100 in Books)
Grokking Algorithms: An illustrated guide for programmers and other curious people Paperback – 31 Dec 2015
Frequently bought together
Customers who bought this item also bought
About the Author
Aditya Bhargava is a Software Engineer with a dual background in Computer Science and Fine Arts. He blogs about programming at adit.io.
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 mobile phone number.
Customers who viewed this item also viewed
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
Most helpful customer reviews on Amazon.com
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. But it if you've trudged through algorithms courses before and feel like you barely gleaned anything.
From the author:
"Who should read this book?
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. Here’s a short, incomplete list of people who will probably find this book useful:
• Hobbyist coders
• Coding boot camp students
• Computer science grads looking for a refresher
• Physics/math/other grads who are interested in programming"
In my opinion, the reason this book is so much better than traditional resources on the subject is that the author adheres to a few basic principles that I find fundamental to learning.
From the author:
"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 so ware engineer, and they provide a good foundation for more complex topics."
The book starts with simple concrete examples and then moves towards abstraction. Most books on the subject start with abstract mathematical equations (symbol soup as the author calls it) and then move towards concrete implementations (or just stay with abstract proofs). That is approach is completely backwards to me, but perhaps it works well for others.