''Grokking Algorithms:'' The Algorithm Book Every Beginner Should Read
Check out this review of the book ''Grokking Algorithms'' by Aditya Bhargava.
Join the DZone community and get the full member experience.Join For Free
So, I have read many books on data structures and algorithms, like Introduction to Algorithms by Thomas H. Corman and Algorithm Design Manual by Steve S. Skiena. When I came across the book Grokking Algorithms, I thought: Oh, it's just another book on algorithms, but I was wrong.
This is not just another book on algorithms but one of the most interesting books you will ever read on algorithms and data structure, particularly for beginners.
While this book doesn't cover all the data structure and algorithms you see in computer science, whatever it does cover, it covers really well. And that's crucial for beginner programmers or computer science students.
It explains algorithms with simple language and, most importantly, with the right context. For example, when Aditya talked about array and linked lists in his book, he provides an example of a group of friends going to the movies and struggling to find seats that are next to each other. He then uses this example to illustrate the problem faced by the array due to the contiguous memory requirement.
There are many such interesting and real-world examples in this book, which makes the complex topic of algorithms and data structures easier to understand.
You will also appreciate his simple explanations like: Why quicksort is more used than merge sort? This is something I thought about before but didn't quite understand, and that is just one example. The book is full of such examples on essential topics like arrays, linked lists, sorting algorithms, searching algorithms, recursion, etc.
If his language and examples were not enough, the graphics and diagrams in the book will surely hook you.
The book has around 400 images and they are all unique (one example is below). They go nicely with the text and help you to visualize how an algorithm is working or how a data structure is working.
Aditya's background in programming and fine arts has really created a nice blend, which came together in the Grokking Algorithms: An Illustrated Guide for Programmersand makes this book must read for any programmer.
What I Liked
Well, to be honest, I like the whole book — from the introduction all the way to the end. This is also one of the few books I have read from start to finish in the last few years. Here is a list of things that I liked, well, in fact, loved, in Grokking Algorithms:
1. Easy-to-understand language
2. Interesting pictures that help visualize the working of algorithms and data structures
3. Provoke thoughts on potential use cases. For example: "When you have to design an app to keep track of your expense, where are you going to need to add and remove items more regularly?"; "Will you need to view it once or twice in a month?"; "Which data structure will you use?" These types of questions.
4. Contemporary examples make it even more interesting. For example, how Facebook stores your username so that they can allow you to log in and handle signups? This consists of an array, linked list, or a hybrid data structure that is made of an array and linked list.
5. Size of the book. Yes — it's not overwhelming, so there are more chances that you will read it and come back again.
6. Covers essential data structures, e.g. array, linked list, and hash table.
These were some of the points that I liked, but overall, Grokking Algorithms is a very readable book with good visual representations, which made this difficult topic relatively easy to understand.
What I Didn't Like
Contrary to what many of you might think, the book is surely not a replacement of classic titles such as Introduction to Algorithms by Thomas H. Cormen because it's not comprehensive and doesn't cover most of the data structure, like Tree, Trie, etc. At best, Cormen's book was more of an introductory book on data structure and algorithms, which makes the somewhat dry topic of data structure and algorithms more interesting.
The following are some of the things that I didn't like in this book:
1. The book is a bit light on data structures, which is a counterpart of algorithms because algorithms work on data structures and the choice of data structure affects the algorithm. It would have been better if Aditya had provided more content on essential data structures like a binary tree, binary search tree, trie, etc.
2. Even though the book covers dynamic programming, greedy algorithms, and explains some advanced algorithms like k-nearest neighbors, it still doesn't cover key algorithms like encoding and encryption algorithms, map-reduce, etc.
He tries to, somewhat, include this in the last chapter on "What's Next," where he provides a brief overview of 10 more algorithms that weren’t covered in the main content. But he could have gone a bit more in depth.
That's all for now on the book Grokking Algorithms: An Illustrated Guide for Programmers. In short, I highly recommend this book to programmers, developers, software engineers, students, computer science graduates, and anyone else who wants to learn more about grokking algorithms.
It's interesting to read, teaches complex concepts in an easy-to-follow language, problem-solving, and focuses on concepts rather than implementations, which means:
Even if you don't code daily, you can still understand how a particular algorithm works and how to choose a particular data structure to solve a problem.
Lastly, it's chapters on arrays and linked lists are one of the best overviews I have ever read, and I strongly recommend all programmers, particularly those who have just started their career, to read this book. It's also not expensive and worth every penny spent.
So, if you do anything right now, just go and read Grokking Algorithm by Aditya Bhargava. Many thanks and kudos to him for writing such an awesome book that makes this topic even more interesting and readable.
Published at DZone with permission of Javin Paul, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.