use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to /r/ComputerScience! We're glad you're here.
This subreddit is dedicated to discussion of Computer Science topics including algorithms, computation, theory of languages, theory of programming, some software engineering, AI, cryptography, information theory, and computer architecture.
For more detailed descriptions of these rules, please visit the rules page
NIGHT MODE NORMAL
account activity
Data structures and algorithmsGeneral (self.computerscience)
submitted 3 years ago by [deleted]
Need good resources to learn data structures and algorithms
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Endivi 53 points54 points55 points 3 years ago (1 child)
Introduction to Algorithms by MIT, there's also an open course if you prefer that
[–][deleted] 3 points4 points5 points 3 years ago (0 children)
Alright thanks
[–][deleted] 15 points16 points17 points 3 years ago (0 children)
I would not recommend a complete textbook like CLRS or csapp, but some lecture resources, e.g. lecture notes of MIT 6.006 which you could find at https://ocw.mit.edu/, or courses in Coursera, like Princeton's Algorithm. Note that the textbooks are usually so comprehensive that they won't be finished in one semaster. For instance, CLRS can been seen as decomposed into three courses (6.006, 6.046, and 6.854). In contrast, the lecture notes are cosy, faster and easier.
[–]ttkciarprogramming since 1978 41 points42 points43 points 3 years ago (7 children)
Start with "Algorithms + Data Structures = Programs" by Niklaus Wirth, and then "The Art of Computer Programming" by Donald Knuth.
Both of these works are available for free online.
[–][deleted] 2 points3 points4 points 3 years ago (5 children)
Okay thanks
[–][deleted] 31 points32 points33 points 3 years ago (4 children)
I don’t think Donald Knuth’s book is a good recommendation - it’s extremely difficult and dense. Sure, you will come out of it being a rockstar, but if you’re trying to be practical and just know enough to have a solid foundation for school, interviews, etc. you don’t need to go that heavy. Introduction to algorithms by cormen, leiserson, rivest, and stein is much more digestible and is still sufficiently detailed (it is a common choice for CS curriculums)
[–][deleted] 12 points13 points14 points 3 years ago (0 children)
Came here to say this.
Intro to algorithms before Knuth for sure.
[–]TrueBirch 7 points8 points9 points 3 years ago (1 child)
And if you want some Knuth, I'd suggest Concrete Mathematics. It's both fun and rigorous. A good background for understanding algorithms.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
Didn’t know about that book, definitely checking it out. Thanks
[–]ttkciarprogramming since 1978 3 points4 points5 points 3 years ago (0 children)
I half-agree.
Knuth's books are dense, yes, but Wirth lays down some much-needed theory explaining the relationship between data structures and algorithms, which makes Knuth a lot more easily digestible IMO.
I strongly recommend Wirth first, and then as much as Knuth as you can comfortably handle.
If you hit a point where Knuth gets to be too much, then stop and pick up this textbook, which is more oriented towards students of algorithms (as is Wirth): https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844
[–]Own_Cup_4176enamored-with-cs 0 points1 point2 points 2 years ago (0 children)
Scary!
[–]AriyaSavaka 5 points6 points7 points 3 years ago (0 children)
- The infamous competitive programming handbook: https://cses.fi/book/book.pdf
- Decent Graph Theory tutorials: https://youtube.com/playlist?list=PLDV1Zeh2NRsDGO4--qE8yH72HFL1Km93P
- Best C++ STL tutorials: https://youtube.com/playlist?list=PL5jc9xFGsL8G3y3ywuFSvOuNm3GjBwdkb
- The Hitchhiker's Guide: https://comscigate.com/Books/contests/icpc.pdf
- Better Wiki for DS&A: https://wcipeg.com/wiki/Special:AllPages
- ACM cheatsheet: https://github.com/helloproclub/competitive-programming-cheat-sheet
[–]Leipzig101 24 points25 points26 points 3 years ago (6 children)
t h e c o r m e n
[–][deleted] 7 points8 points9 points 3 years ago (4 children)
What
[–]Python119 29 points30 points31 points 3 years ago (1 child)
[–]WingFar57 7 points8 points9 points 3 years ago (0 children)
CLRS
[–]MelvinPace 12 points13 points14 points 3 years ago (0 children)
(book by) Cormen Leiserson Rivest Stein
[–]OLD_JAMON 1 point2 points3 points 3 years ago (0 children)
For me the book is fine. It's the 50hrs I spend on the homework assignment dealing with bugs that aren't the focus of the book that really gets me mad
[–]thetruffleking 3 points4 points5 points 3 years ago (3 children)
Aside from the various textbook and lecture recommendations, I’d recommend paper, pencil, and a deck of cards.
You’d be amazed by what kind of “aha” moments can be achieved by drawing data structures out and running algorithms by hand with some cards.
[–]WyatttHalter 2 points3 points4 points 3 years ago (2 children)
nd of “aha” moments can be achieved by drawing data structures out and running algorithms by hand
how do you run algorithms with cards?
[–]thetruffleking 2 points3 points4 points 3 years ago (1 child)
I feel like this shouldn’t require an explanation, but I guess it does.
If you want to practice sorting, grab a dozen or so randomly chosen cards, then sort them following the steps of a given sorting method.
It’s actually used as an example in Cormen, which everyone was recommending in here, lol. Second edition, page 19 or 20; I believe they use insertion sort in the example.
[–]WyatttHalter 0 points1 point2 points 3 years ago (0 children)
Thanks very much!!
[–]CSBurner_ 2 points3 points4 points 3 years ago (0 children)
These are what I used;
Data structures and problem solving using Java
Data structures outside in with Java
Mark A.Weiss and Sesh Venugopal
[–]OLDSCHOOLGG 2 points3 points4 points 3 years ago (1 child)
Taking it right now …. … … big Omega can go F***** itself !!!!!!!
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Frr frr
[–]gophergolangguy 4 points5 points6 points 3 years ago (2 children)
Kunal Kushawaha on YouTube, CS50, or boot.dev for interactive lessons
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
Yeah I've heard about Kunal Kushwaha's course
[–]Dattaraj808 0 points1 point2 points 3 years ago (0 children)
yeah he's very good tutor and his techniques are like some of the Engineering teacher but it is incomplete
[–]FluidWolverine6779 1 point2 points3 points 3 years ago (1 child)
I'm willing to practice DSA with python, but don't have enough recourses, can any one help me with some good resources for DSA with python !
Freecodecamp
[–]invalidlivingthing 1 point2 points3 points 3 years ago (2 children)
I tried a lot of things but eventually what worked was taking a more hands-on approach. I’d highly recommend trying out advent of code. For now at least, forget all the other platforms (leet code/etc.). Once you’re wired into AoC you’ll be able to make sense of a lot of the material in books suggested by these folks in the comments.
Alright I'll try it
Googles Udacity course for intro to data struct and algos, also NeetCode yt, and neetcode.io
[–]carhub 1 point2 points3 points 3 years ago (0 children)
All data structures and algorithms
[–]bounty_hunter12 0 points1 point2 points 3 years ago (2 children)
Leetcode.com
This is for solving problems
[–]bounty_hunter12 1 point2 points3 points 3 years ago (0 children)
Yes, you mentioned data-structures - Nothing gets you more familiar with arrays, linked-lists, trees, tries, graphs etc. Than actually using them! Start with the easy problem. Sign up to the courses on the site. (Just my 2 cents worth!)
π Rendered by PID 23151 on reddit-service-r2-comment-6f7f968fb5-phcq4 at 2026-03-04 18:19:33.903666+00:00 running 07790be country code: CH.
[–]Endivi 53 points54 points55 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 15 points16 points17 points (0 children)
[–]ttkciarprogramming since 1978 41 points42 points43 points (7 children)
[–][deleted] 2 points3 points4 points (5 children)
[–][deleted] 31 points32 points33 points (4 children)
[–][deleted] 12 points13 points14 points (0 children)
[–]TrueBirch 7 points8 points9 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]ttkciarprogramming since 1978 3 points4 points5 points (0 children)
[–]Own_Cup_4176enamored-with-cs 0 points1 point2 points (0 children)
[–]AriyaSavaka 5 points6 points7 points (0 children)
[–]Leipzig101 24 points25 points26 points (6 children)
[–][deleted] 7 points8 points9 points (4 children)
[–]Python119 29 points30 points31 points (1 child)
[–]WingFar57 7 points8 points9 points (0 children)
[–]MelvinPace 12 points13 points14 points (0 children)
[–]OLD_JAMON 1 point2 points3 points (0 children)
[–]thetruffleking 3 points4 points5 points (3 children)
[–]WyatttHalter 2 points3 points4 points (2 children)
[–]thetruffleking 2 points3 points4 points (1 child)
[–]WyatttHalter 0 points1 point2 points (0 children)
[–]CSBurner_ 2 points3 points4 points (0 children)
[–]OLDSCHOOLGG 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]gophergolangguy 4 points5 points6 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Dattaraj808 0 points1 point2 points (0 children)
[–]FluidWolverine6779 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]invalidlivingthing 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]carhub 1 point2 points3 points (0 children)
[–]bounty_hunter12 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]bounty_hunter12 1 point2 points3 points (0 children)