TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do I learn Data Structures and Algorithms

19 pointsby varbhatalmost 4 years ago
I want to learn Data Structures and Algorithms. I want to do this for my knowledge sake and also to prepare for jobs.<p>So, where do i start ? which resources&#x2F;books would you recommend ? How do i master Data Structures and Algorithms?

13 comments

heldridaalmost 4 years ago
This subject has been discussed a lot of times and there is an insane number of content available for free. Even high quality courses from MIT, etc, all for free! From udacity, to udemy, to khan academy, to youtube, etc.<p>An example to get started apart from those millions of options you have available for free, there&#x27;s: &quot;Grokking Algorithms: An illustrated guide for programmers and other curious people&quot;
评论 #27211962 未加载
Trasteralmost 4 years ago
If you want to learn it for job interviews, I&#x27;ve got to say, just trawling through hacker rank[1] practice questions for C++. Read the question, attempt the question, read up on the theory behind the question and read the discussion pages. Then maybe attempt a similar question from some other very similiar sites. It&#x27;s very possible to just cover all the possible questions and it&#x27;s probably going to give you the tools you need to answer any interview coding test. The only real thing it sometimes doesn&#x27;t give you is recognizing which algorithm to use for a specific problem - very often interview questions are very poorly disguised variations on &quot;do you know what a dictionary is and how it&#x27;s implemented&quot;.<p>To learn more deeply about algorithms I&#x27;d probably start off with MIT courses.<p>[1] - <a href="https:&#x2F;&#x2F;www.hackerrank.com&#x2F;domains&#x2F;cpp" rel="nofollow">https:&#x2F;&#x2F;www.hackerrank.com&#x2F;domains&#x2F;cpp</a>
strikelaserclawalmost 4 years ago
i keep CLRS as a reference book and i regularly read a chapter on something i find interesting, it&#x27;s been a great book in my collection. For lectures, i recommend the algorithms course by Robert Sedgewick on Coursera, his way of presenting the material is extremely clear. Here are some key things i think you should know : 1)analyzing time + space complexity - omega (lower bound), theta, and big o notation 2) quick sort, merge sort (study quick sort more extensively because the partitioning idea is used in other algorithms), radix sort (what does it mean when a sort is stable? why is this idea important) - radix sort is used in some string sorting algorithms 2)binary search 3)Binary Search Trees, maybe a little bit about B-Trees (this is more for personal knowledge than interviews) 4)dictionary implementation 5)Graph representation (adj-list-matrix) and graph processing algorithms (mainly DFS and BFS and what properties do they have? can you detect a cycle in a graph?) You could also study minimum spanning tree algorithms and shortest path algorithms 6)Backtracking 7)Dynamic programming 8)Greedy algorithms<p>finally get a leetcode account. In many leetcode problems you don&#x27;t need to know alot of these things i mentioned but studying those topics will allow you to learn different ways of thinking about problems solving.
0xhhalmost 4 years ago
A year ago, I was like you. I can&#x27;t understand a single piece of it. I went on sailing in the ocean of youtube videos. I did&#x27;nt even understand how Linked List works. I mean, I can really draw how it works but can&#x27;t implement it. A month later, I realized that I was not strong in C&#x2F;C++ pointers and structures. I tried to learn them again from scratch and then I kind of understood the implmentation. I started off with Linked Lists and then went on with stacks, queues and trees. I was not strong in C or C++ and that was the reason why I didn&#x27;t understand basic concepts. If you want to learn data structures in C&#x2F;C++, then make sure that you understand pointers and structures. If you choose to do it in Java or Python or some other language with OOP, then you should understand how Classes and Objects work and how to store the addresses of other objects of same class. I want to tell you one thing, take your time. Don&#x27;t stress at all.
ArtWombalmost 4 years ago
Stanford CS 161 undergrad algo course<p><a href="https:&#x2F;&#x2F;timroughgarden.org&#x2F;videos.html" rel="nofollow">https:&#x2F;&#x2F;timroughgarden.org&#x2F;videos.html</a><p>U Illinois CS 374 undergrad algo course<p><a href="https:&#x2F;&#x2F;jeffe.cs.illinois.edu&#x2F;teaching&#x2F;algorithms&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jeffe.cs.illinois.edu&#x2F;teaching&#x2F;algorithms&#x2F;</a><p>If you are just looking for code in dozens of languages, Rosetta Code has many examples<p><a href="http:&#x2F;&#x2F;www.rosettacode.org&#x2F;wiki&#x2F;Category:Programming_Tasks" rel="nofollow">http:&#x2F;&#x2F;www.rosettacode.org&#x2F;wiki&#x2F;Category:Programming_Tasks</a><p>Best of Luck ;)
austincheneyalmost 4 years ago
Practice building things.<p>My first personal software application was a diff tool that compared beautified code thereby ignoring differences due to whit space and comments. I eventually moved from a bunch of plugins to custom parsers and just figured it out through trial and error.
cocoa19almost 4 years ago
Algorithms by Robert Sedgewick.<p>It covers the basics and compared to CLRS, this book is very easy to read.
asicspalmost 4 years ago
There&#x27;s a list of resources here: <a href="https:&#x2F;&#x2F;github.com&#x2F;tayllan&#x2F;awesome-algorithms" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tayllan&#x2F;awesome-algorithms</a>
mraza007almost 4 years ago
Very useful suggestions from the community but my question is that how often data structures are implemented on a real job like the way they are asked in the interview
评论 #27211042 未加载
oxide1almost 4 years ago
Introduction to Algorithms by Cormen et al (colloquially known as CLRS) is a pretty good place to start.
dominotwalmost 4 years ago
get a book, read a topic, solve leetcode with those tags. rinse and repeat.
gdixit369almost 4 years ago
Yeah I learned data structures and algorithm
qq4almost 4 years ago
Write a chess engine from scratch.