by OulaX on 11/14/21, 2:12 PM with 96 comments
But I want a structured guide / textbook that I can follow which also contains exercises.
I have checked the CLRS book, but, it's more of a reference than a book that you can read from cover to cover. For example a basic Stack is explained in a page and a half or two, for me this is not enough, I want a book that can go into the details of each specific DS or Algorirhm.
*TL;DR:* Are there any books better than CLRS for DS & Algos?
by ioli on 11/14/21, 3:24 PM
Amazing book. Very readable. I highly recommend it. The book has a section call "War story" at the end of each chapter in which Skiena shares his real life experience of when the contents from that particular chapter came in handy for him.
Go through it. You won't regret
https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena...
by alanfranz on 11/14/21, 4:06 PM
https://algs4.cs.princeton.edu/home/
You can even find an excellent two-part MOOC on Coursera:
https://www.coursera.org/learn/algorithms-part1
https://www.coursera.org/learn/algorithms-part2
Maybe it's not the "purest" class or book, but it's engaging and it lets you understand how algos work AND how to use them in practice.
by dyeje on 11/14/21, 4:58 PM
If you're interviewing for senior positions, it is worthwhile to read through Designing Data Intensive Systems. This will prepare you for System Design interviews where you do need to actually understand stuff.
by hiyer on 11/14/21, 3:10 PM
1. https://www.amazon.com/Algorithms-4th-Robert-Sedgewick/dp/03...
by WillDaSilva on 11/14/21, 3:45 PM
It's available for free online, or if you'd like you can buy a physical copy. It's got 14 chapters that take you through a variety of data structures, introduces you to the theory behind them, and teaches you the basics of analyzing them.
I've done many of the exercises from this book, and found them useful for learning the topic.
by stickyricky on 11/14/21, 3:46 PM
by e9 on 11/14/21, 3:44 PM
What really put me to the next level is this amazing free training program which I still recommend anyone who wants to nail the interviews. It teaches each algorithm and data structure and gives you appropriate challenging exercises so you really understand them: https://train.usaco.org/
by usrme on 11/14/21, 3:28 PM
by lr1970 on 11/14/21, 5:49 PM
The book not only describes the algorithms per se, but also teaches how to think about the algorithms and the problems they are solving. I enjoyed it very much as a complimentary reading to the classic Knuth volumes.
by bXVsbGVy on 11/14/21, 3:07 PM
I'm not aware of any book like that. At the uni, the process is repetitive and incremental.
First you learn how to implement the algo, then you learn how to count (discrete math) and, finally, you learn how to analyze its complexity. Concurrently, you might see some more details on how those data structure are used in Operating System and learn how to implement them in some lecture about parallel computing.
MIT has a great resource online. They have recorded lecture, exercises, lecture notes with reading suggestion, etc.
Their intro to algo. https://ocw.mit.edu/courses/electrical-engineering-and-compu...
Also, see what it the reading for similar lectures on other universities.
by thesuperbigfrog on 11/14/21, 2:56 PM
by curtainvase on 11/14/21, 3:08 PM
by MyAnonymousAcc on 11/14/21, 4:01 PM
by rramadass on 11/15/21, 11:16 AM
* 1) Functions and Graphs and 2) The Method of Coordinates by I.M.Gelfand et. al. - These give you the basics on functions and how to visualize them which is crucial for understanding.
* Introductory Logic and Sets for Computer Scientists by Nimal Nissanke - Nice succinct introduction to various required topics for Comp. Sci.
* Compared To What?: Introduction to the Analysis of Algorithms by Gregory Rawlins - This is a classic book which takes you by hand and walks you through Algorithm Analysis and the reqd. mathematics. You will find this more approachable than most other text books and well worth a study.
* How to Think about Algorithms by Jeff Edmonds - Practical techniques without too much mathematical formalism.
* Data Structure Techniques by Thomas Standish - A Classic text; good adjunct to more modern texts.
* Advanced Data Structures by Peter Brass - Nice succinct text but not necessarily "advanced".
One final point; try to get a Algorithms and Data Structures book with code in the language with which you are most familiar. That way you understand the mapping from "Abstract Algorithm" to "Concrete Language Implementation" which is not always trivial.
by Someone on 11/14/21, 3:36 PM
Unfortunately, it isn’t done yet (1), and the completed parts have are very basic and have parts that are a bit dated (multi-tape sorting, for example)
(1) and likely never will be. Knuth is turning 84 in two months, and isn’t even halfway writing it, after almost 60 years
by dhanna on 11/14/21, 4:26 PM
I liked ALGS4 by Sedgewick as my introduction to Algorithms. I still refer to the Coursera course. I actually started with CLRS and doubled back to ALGS4. I wish I did it in reverse order but it was still useful reading CLRS and refreshing my math skills.
I would say grab a few and see which ones you like. CLRS, ALGS4, Algorithm Design Manual, and Algorithm Design by Kleinberg and Tardos are a good start. You can look in the bibliography of each books for more suggestions from the experts themselves.
by chris_l on 11/14/21, 3:57 PM
by aabaker99 on 11/14/21, 4:59 PM
I admit I haven't explored many other books on this topic but CLRS is very good in my opinion.
by jstx1 on 11/14/21, 2:29 PM
Why not? It's a simple data structure. What more do you think can be said about it?
by annoying_code on 11/16/21, 7:53 AM
And I think graph is a data structure that you should be work upon. For this you can refer this book Introduction to Graph Theory Subsequent Edition by Douglas Brent West. This book you can just read and practice while solving problems on above coding problem platforms.
So, I recommend you first do code-forces DIV3, DIV2 problems, gain some confidence, and then pick any DSA book.
Or one thing you can also do just filter out problems related to math,Combinatorics etc.on code-forces and try to solve them. Through this approach you will learn to apply the concepts.
I hope this comment add some value to you! Happy coding.
by issirsq3 on 11/19/21, 9:40 AM
https://www.amazon.de/Problem-Solving-Algorithms-Structures-... If I remember correctly it is Python 2
https://www.amazon.de/Algorithms-Illuminated-Part-1-Basics/d...
https://www.amazon.de/Algorithms-Illuminated-Part-Graph-Stru...
https://www.amazon.de/Algorithms-Illuminated-Part-Dynamic-Pr...
by tarsinge on 11/14/21, 8:11 PM
by zamkam on 11/19/21, 2:26 PM
by truly on 11/14/21, 9:22 PM
For example, the Stack data structure that you bring into discussion is quite simple (but interesting and important), so I am not surprised it is treated speedily. Introduction to Algorithms typically has more difficult content.
Depending on this, I could recommend for example that you follow the lectures on the excellent MIT OCW YouTube channel (https://www.youtube.com/c/mitocw). But you could also do one of the numerous algorithms and data structures courses on coursera/edx. It all depends on what you know so far and what your goal is.
by stefanos82 on 11/14/21, 7:42 PM
https://algodaily.gumroad.com/l/yYEqr
I really loved its illustrations; it looks so easy to follow.
by jventura on 11/19/21, 3:21 PM
For instance, to teach what a stack is I’ll explain the basic idea of a stack, then provide a base class and the reader must implement each method (init, push, pop, peek, etc) given the requirements and intended results of each functionality.
I already have a kind-of “learn by doing” ebook about Python (https://github.com/joaoventura/full-speed-python), so it’s like a follow-up to that one.
Don’t know if people are interested in a book like this, though..
by _448 on 11/14/21, 4:11 PM
[0] https://www.edx.org/course/data-structures-an-active-learnin...
by morty_s on 11/14/21, 9:38 PM
Otherwise, for more reading on linked lists, read through adlist.c from redis, by antirez.
Next, one of the best books (IMO) on algorithmic thinking is SICP. Get through a few chapters, do the exercises, grok recursion, etc.
In no particular order:
Algorithm Design Manual, Skiena
Algorithm Design, by Kleinberg/Tardos
Algorithms, Sedgwick 4th ed. (also Algorithms in C)
If you find you need or would like more math:
Discrete Mathematics (Epp is an easier read, Rosen seems more verbose)
Mathematical Proofs, Charrand
For interview prep:
Elements of Programming Interviews (EPI)
Designing Data Intensive Applications
by rajansaini on 11/18/21, 6:11 AM
This is better for more advanced topics, like dynamic programming (well, advanced for me, anyway). I started out taking over an hour to solve the first problem in the problem sets, but they build on each other slowly, so I was soon able to see solutions within minutes. It took me a weekend to go through chapters I was struggling with, and I did really well on my coding interview the next day.
by bsuvc on 11/14/21, 6:12 PM
Perhaps you would benefit from pairing it with a MOOC like MIT's Introduction to Algorithms. https://ocw.mit.edu/courses/electrical-engineering-and-compu...
by say_it_as_it_is on 11/15/21, 11:33 AM
by wagslane on 11/15/21, 4:16 AM
by rob_c on 11/14/21, 8:37 PM
Every time I've been involved in projects using 10TB+ data it's the processing that tends to expose the most bottlenecks. Nothing competes with making a pseudo dataset about 5%-10% of the size and running benchmarks which roughly match your expected workflow.
Good luck
by MalayAgr on 11/19/21, 4:09 PM
by fsloth on 11/14/21, 5:52 PM
by b20000 on 11/14/21, 3:24 PM
by jypepin on 11/14/21, 4:50 PM
by eitland on 11/14/21, 3:13 PM
I can't say if it is good or not, I lost mine well over a decade ago.
by aynyc on 11/14/21, 5:23 PM
by laxmena on 11/14/21, 6:14 PM
Grokking Algorithms -Aditya Bhargava
Cracking the Coding Interview Book by Gayle Laakmann McDowell
by rpac0 on 11/14/21, 7:46 PM
by anuragbiyani on 11/14/21, 6:54 PM
In addition to what others have mentioned, here are some example resources you might prefer for a beginner-intermediate level intro:
1. (free online) Algorithms by Dasgupta, Papadimitriou, and Vazirani http://algorithmics.lsi.upc.edu/docs/Dasgupta-Papadimitriou-...
2. (free online) Algorithms by Jeff Erickson https://jeffe.cs.illinois.edu/teaching/algorithms/
3. Algorithm design by Kleinberg & Tardos https://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/032...
4. Another one specifically for more applied view (esp., how they are used in programming contests such as ICPC) is Skiena & Revilla's "Programming Challenges" book (https://www.amazon.com/Programming-Challenges-Contest-Traini...). Note that this is different than Skiena's other popular book (Algorithm Design manual) which is also pretty good and has a "war story" based perspective to design of algorithms.
5. There are also several resources where lecture notes from university Algorithm & DS courses are very useful. Here is an example from my previous Professor, David Kempe: http://david-kempe.com/teaching/DataStructures.pdf
6. Several programming competition specific tutorials can be found on Topcoder: https://www.topcoder.com/thrive/tracks?track=Competitive%20P... (individual SRM archives are also good place to try problems first hand and then learn from other's approach). In general, if you search for ACM-ICPC resources, you will find a lot more targeted information/problems which will apply not only for leetcode, but also for detailed understanding of the theory too.
by uptheroots on 11/14/21, 4:57 PM
by iamsb on 11/14/21, 3:37 PM
by salutis on 11/14/21, 7:25 PM
algorithms.wtf
Algorithms by Jeff Erickson
by zamkam1031 on 11/21/21, 4:33 AM