<p><a href="https://rads.stackoverflow.com/amzn/click/com/0262033844" rel="nofollow noreferrer" rel="nofollow noreferrer">Cormen's,  Leiserson's, Rivest's and Stein's <em>Introduction to Algorithms and Data Structures</em></a> is widely considered a most great book on the topic in question.</p>
<p>Even when googling <a href="https://www.google.com/search?q=best+algorithms+and+data+structures+book&amp;sxsrf=ALiCzsZ5I-dytHJJnMHcmYHgrK4U1t-ANg%3A1657538086381&amp;ei=JgbMYuTzFvHFrgTC_rC4DA&amp;ved=0ahUKEwjkntzG2vD4AhXxoosKHUI_DMcQ4dUDCA4&amp;uact=5&amp;oq=best+algorithms+and+data+structures+book&amp;gs_lcp=Cgdnd3Mtd2l6EAMyBQgAEIAEMgUIABCABDIGCAAQHhAWMgYIABAeEBYyBggAEB4QFjIGCAAQHhAWMgYIABAeEBY6BwgAEEcQsAM6BwgAELADEEM6CggAEOQCELADGAE6EgguEMcBENEDEMgDELADEEMYAjoMCC4QyAMQsAMQQxgCSgQIQRgASgQIRhgBUKYEWJ4GYI0HaAJwAXgAgAF1iAGrApIBAzIuMZgBAKABAcgBDsABAdoBBggBEAEYCdoBBggCEAEYCA&amp;sclient=gws-wiz" rel="nofollow noreferrer">&quot;best algorithms and data structures book&quot;</a>, <a href="https://www.tableau.com/learn/articles/books-about-data-structures-algorithms" rel="nofollow noreferrer">first</a> <a href="https://www.interviewbit.com/blog/data-structures-and-algorithms-books/" rel="nofollow noreferrer">few</a> <a href="https://www.guru99.com/data-structure-algorithms-books.html" rel="nofollow noreferrer">links</a> place it at the top of their lists. Some even mention that it's sometimes called &quot;the bible of algorithms&quot;.</p>
<p>That book covers not only the basics, but also topics above the &quot;standard&quot; level of Leetcode exercises. I highly recommend starting with it. After you finish it, I believe the best course of action is to reserach individual topics that cought your interest.</p>
<p>There is one more thing I would like to touch on. A mistake some people make is trying to read those kind of books from cover to cover and only afterwards jump into coding. This approach is, most of the time, very inefficient. Once you learn an algorithm or a data structure, try using it, implementing it, and tweaking it. Experiment with the knowledge you are gathering on your way, rather than trying to isolate it.</p>

CC BY-SA 4.0
2022-07-11T13:50:22.780Z
I am looking for something other than Cormen's Introduction to Algorithms and Data Structures. I heard it reads like a dictionary for algorithms and data structure. I want something lighter and more fun to read. Do you have any recommendations or should I just man it up and go with Cormen's?
Nazmus Saqueeb Ashrafi
CC BY-SA 4.0
2022-07-11T14:38:07.503Z
Unfortunately I am not aware of a ADS (algorithms and data structures) book that is primarily aiming to be as light as possible. ADS is a technical topic very close to mathematics. You may find more luck by looking for courses rather than books given your criteria.
Fureeish
CC BY-SA 4.0
2022-07-11T18:56:52.713Z
@NazmusSaqueebAshrafi If you are looking for entertainment I'm sure you can find lighter explanations. I.e. all search algorithms have corresponding dance videos like https://www.youtube.com/watch?v=lyZQPjUT5B4, but as Fireeish pointed out this is a topic that requires effort and it is very unlikely you can learn it without your own work irrespective what media (books, videos or lectures, audio-books, comics) work for you to study.
Alexei Levenkov
CC BY-SA 4.0
2022-07-11T20:25:14.457Z
" I heard it reads like " You mean you're dismissing it without actually looking at it?
Victor Eijkhout
CC BY-SA 4.0
2022-07-15T02:39:43.650Z
@VictorEijkhout No not being dismissive, just looking for a different approach. I was just looking for a different approach/take to algorithms than Cormen.
Nazmus Saqueeb Ashrafi
CC BY-SA 4.0
2022-07-16T19:52:34.873Z
Leetcode is generally not terribly theoretical. You need basic complexity (the difference between quadratic and linear, mostly), graphs (DFS/BFS), n-ary trees, arrays, strings, DP. Using CLRS to prepare for LC is overkill and will dip into randomized algorithms, FFT, ML, NP completeness, max flow, creating hash tables from scratch, self-balancing trees, and other theoretical topics that have little to no bearing on LC (not that they aren't great on their own terms, just less relevant to LC, and should be reserved for later when a special occasion arises).
ggorlen
CC BY-SA 4.0
2022-08-04T23:03:23.503Z
I found the 1990 edition of Sedgewick's _Algorithms In C_ very readable and enjoyable — it explained enough of each algorithm to give you the idea and enable you to go off and start coding it, but not enough to be dry and tedious. (I've only glanced at more recent editions, but my impression was that they're much more detailed and less fun.)
gidds
CC BY-SA 4.0
2022-07-11T11:21:56.623Z
2022-07-23T13:11:26.820Z
2022-07-23T13:11:26.820Z
Fureeish
<p>I am really interested in diving into leetcode. However, I want a solid foundation on data structures and algorithms being used to solve the problems in Leetcode. Please recommend to me some books/resources which would help me. Thanks</p>

CC BY-SA 4.0
2022-07-16T19:55:25.127Z
What makes you think you need a book before starting? All topics are tagged, so you can pick basic problem, work up to harder problems, and search for particular concepts as you need them. Algorithms and data structures are huge topics, so starting with the book may result in a lot of extra information that's hard to see the purpose of.
ggorlen
<programming><algorithms><data-structure>
Which is the best book for algorithms before I dive into Leetcode?
# Which is the best book for algorithms before I dive into Leetcode?

(Asked by: username_0 on 2022-07-07)

I am really interested in diving into leetcode. However, I want a solid foundation on data structures and algorithms being used to solve the problems in Leetcode. Please recommend to me some books/resources which would help me. Thanks

**Tags:** programming, algorithms, data-structure

> **Comments:**
> **username_1**: What makes you think you need a book before starting? All topics are tagged, so you can pick basic problem, work up to harder problems, and search for particular concepts as you need them. Algorithms and data structures are huge topics, so starting with the book may result in a lot of extra information that's hard to see the purpose of.  

---

## 1 answers

### Answer by username_2 on 2022-07-11. Score: 4 | Accepted answer

[Cormen's, Leiserson's, Rivest's and Stein's *Introduction to Algorithms and Data Structures*](https://rads.stackoverflow.com/amzn/click/com/0262033844) is widely considered a most great book on the topic in question.

Even when googling ["best algorithms and data structures book"](https://www.google.com/search?q=best+algorithms+and+data+structures+book&sxsrf=ALiCzsZ5I-dytHJJnMHcmYHgrK4U1t-ANg%3A1657538086381&ei=JgbMYuTzFvHFrgTC_rC4DA&ved=0ahUKEwjkntzG2vD4AhXxoosKHUI_DMcQ4dUDCA4&uact=5&oq=best+algorithms+and+data+structures+book&gs_lcp=Cgdnd3Mtd2l6EAMyBQgAEIAEMgUIABCABDIGCAAQHhAWMgYIABAeEBYyBggAEB4QFjIGCAAQHhAWMgYIABAeEBY6BwgAEEcQsAM6BwgAELADEEM6CggAEOQCELADGAE6EgguEMcBENEDEMgDELADEEMYAjoMCC4QyAMQsAMQQxgCSgQIQRgASgQIRhgBUKYEWJ4GYI0HaAJwAXgAgAF1iAGrApIBAzIuMZgBAKABAcgBDsABAdoBBggBEAEYCdoBBggCEAEYCA&sclient=gws-wiz), [first](https://www.tableau.com/learn/articles/books-about-data-structures-algorithms) [few](https://www.interviewbit.com/blog/data-structures-and-algorithms-books/) [links](https://www.guru99.com/data-structure-algorithms-books.html) place it at the top of their lists. Some even mention that it's sometimes called "the bible of algorithms".

That book covers not only the basics, but also topics above the "standard" level of Leetcode exercises. I highly recommend starting with it. After you finish it, I believe the best course of action is to reserach individual topics that cought your interest.

There is one more thing I would like to touch on. A mistake some people make is trying to read those kind of books from cover to cover and only afterwards jump into coding. This approach is, most of the time, very inefficient. Once you learn an algorithm or a data structure, try using it, implementing it, and tweaking it. Experiment with the knowledge you are gathering on your way, rather than trying to isolate it.

> **Comments:**
> **username_0**: I am looking for something other than Cormen's Introduction to Algorithms and Data Structures. I heard it reads like a dictionary for algorithms and data structure. I want something lighter and more fun to read. Do you have any recommendations or should I just man it up and go with Cormen's?  
> **username_2**: Unfortunately I am not aware of a ADS (algorithms and data structures) book that is primarily aiming to be as light as possible. ADS is a technical topic very close to mathematics. You may find more luck by looking for courses rather than books given your criteria.  
> **username_3**: @NazmusSaqueebAshrafi If you are looking for entertainment I'm sure you can find lighter explanations. I.e. all search algorithms have corresponding dance videos like https://www.youtube.com/watch?v=lyZQPjUT5B4, but as Fireeish pointed out this is a topic that requires effort and it is very unlikely you can learn it without your own work irrespective what media (books, videos or lectures, audio-books, comics) work for you to study.  
> **username_4**: " I heard it reads like " You mean you're dismissing it without actually looking at it?  
> **username_0**: @VictorEijkhout No not being dismissive, just looking for a different approach. I was just looking for a different approach/take to algorithms than Cormen.  
> **username_1**: Leetcode is generally not terribly theoretical. You need basic complexity (the difference between quadratic and linear, mostly), graphs (DFS/BFS), n-ary trees, arrays, strings, DP. Using CLRS to prepare for LC is overkill and will dip into randomized algorithms, FFT, ML, NP completeness, max flow, creating hash tables from scratch, self-balancing trees, and other theoretical topics that have little to no bearing on LC (not that they aren't great on their own terms, just less relevant to LC, and should be reserved for later when a special occasion arises).  
> **username_5**: I found the 1990 edition of Sedgewick's _Algorithms In C_ very readable and enjoyable — it explained enough of each algorithm to give you the idea and enable you to go off and start coding it, but not enough to be dry and tedious. (I've only glanced at more recent editions, but my impression was that they're much more detailed and less fun.)  

---

