TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How can a dummy like me learn algorithms?

30 点作者 alansmitheebk大约 9 年前
I don&#x27;t have a CS degree. I sucked at math in high school. I never took calculus. I need to learn the classic algorithms to frow as a programmer. I have found some resources on coursera and some books, but most require knowledge of proofs and other maths stuff I never learned. Can anyone point me to some resources for learning enough basic maths to then learn algorithms?<p>I realize that I probably sound like a complete idiot here. I genuinely want to better myself and I&#x27;m humbly asking for help.<p>TIA Alan

14 条评论

skylark大约 9 年前
As someone who was pretty &quot;good&quot; at math and CS algorithms, I&#x27;ll let you in on a little secret: None of this is comes naturally to me. I struggle when encountering new ideas that I&#x27;ve never seen before. I&#x27;ve bombed easy technical interview questions because I couldn&#x27;t make the right logical leap.<p>I still got good grades back in the day because I worked hard. I ground problems until things made sense. Every problem you do adds to your problem solving toolbelt. As your toolbelt grows, you start noticing patterns and you can apply those tools to these new problems. I rarely have to derive things from first principles because I&#x27;ve seen so many different problems at this point.<p>Some people think that I&#x27;m unusually smart or have a natural aptitude for these things. That can&#x27;t be further from the truth - I don&#x27;t think this comes naturally to most people. You just work at it until you get good at it.<p>The best textbook I&#x27;ve found for Algorithms is the one used at Princeton: Sedgewick&#x27;s &quot;Algorithms.&quot; It&#x27;s extremely practical and doesn&#x27;t go into too much of the math&#x2F;proofs behind the algorithms themselves. From there, just grind problems until it makes sense.
firebones大约 9 年前
Since you don&#x27;t have a CS degree, and since your goal might be characterized as practical growth, here&#x27;s a shortcut guide:<p>* Learn the Big-O notation characteristics of data structures and algorithms you&#x27;re going to use in the real world. Understanding data structure selection is probably more important than understanding the algorithms<p>* If you want to learn algorithms, the best (empirical) place to start is with solving real problems, efficiently. So some of the contests&#x2F;HackerRank type things here would be very good. Try them on your own--don&#x27;t worry about efficiency, just worry about a working answer. Then go study the right answer for the problems. Understand the solutions thoroughly.<p>* Don&#x27;t be afraid to prematurely optimize some problem you have to solve. Trying to eke out more performance is a great way of understanding the representation of data and its transformation. You&#x27;ll be well on your way.<p>I&#x27;ve been in the industry for decades. The number of sorting algorithms I&#x27;ve written in college versus ones I&#x27;ve written in industry is still at least 5:1. But I&#x27;ve had to optimize far more stuff in industry than I did in college, and develop algorithms for solving real problems that wouldn&#x27;t make sense to teach in school. So expose yourself to solving real problems! It&#x27;ll pay off.
qwertyuiop924大约 9 年前
Khanacademy has some good resources, seemingly, including teaching Big-O notation. Also, if you are familiar with a programming language in particular, Rosetta Code can give you an example of the algorithm in that language.<p>But in my experience (which should be taken with a grain of salt, as a person who never took cs and never took calculus), understanding algorithms doesn&#x27;t take a lot of math, just a bit of persistance in understanding how they work, and a dash of common sense. The hardest math is that behind calculating big-O for time and space, which can again be approximated for most simple algorithms with a bit of common sense. This (<a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;487258&#x2F;plain-english-explanation-of-big-o" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;487258&#x2F;plain-english-expl...</a>) stackoverflow is probably the best explanation I&#x27;ve seen.<p>SOME ALGORITHMS TO KNOW:<p>-Quicksort<p>-Mergesort<p>-Binary Search<p>-Searching a single-linked list<p>-Hashtable insertion&#x2F;deletion<p>-Djkstra&#x27;s Algorithm<p>-Heap Sort<p>-Huffman Encoding<p>You don&#x27;t have to know all of these, and the difficulty of understanding varies, but these are important, and a good place to start.
bko大约 9 年前
Try something like HackerRank. It&#x27;s pretty fun, bite-sized problems that range in difficulty. I found implementing algorithms result in a deeper understanding that just studying pseudo-code. When you go back and read more about the algorithm you implemented, it&#x27;ll make much more sense.
a-saleh大约 9 年前
I think greatest dis-advantage you will face when you would try to learn this outside of university is that you probably won&#x27;t have class-mates to help you and professor to give you an exam at the end. One of the reasons why I finished uni was peer-pressure, i.e: when my friend managed to pass that exam already, darn, I shall sit on these algorithms until I am able to explain them in my sleep :) Fortunately, many MOOC are trying to replicate the claasroom experience now, if you had similar experience.
gautamnarula大约 9 年前
I really enjoyed Robert Sedgewick&#x27;s Algorithms (part I and II) courses on Coursera. I learned much more in those classes than I did in my data structures class in college. The textbook that accompanies it (Algorithms Fourth edition) is really good too. I left that course with a much, much stronger understanding and appreciation for algorithms&#x2F;data structures.
fergyfresh大约 9 年前
HackerRank is great. I agree with @bko. I would also like to point out a few books that I read in college that helped me out too. Cracking the Coding Interview is a great book that explains the most common algorithms job interviews will ask. Reading is my favorite way of learning.<p><a href="http:&#x2F;&#x2F;www.amazon.com&#x2F;Cracking-Coding-Interview-Programming-Questions&#x2F;dp&#x2F;098478280X" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;Cracking-Coding-Interview-Programming-...</a>
hvo大约 9 年前
Hey, you may not need much maths for this.You just need to be familiar with python and ready to work.It is pretty straightforward <a href="http:&#x2F;&#x2F;interactivepython.org&#x2F;runestone&#x2F;static&#x2F;pythonds&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;interactivepython.org&#x2F;runestone&#x2F;static&#x2F;pythonds&#x2F;index...</a>
Dowwie大约 9 年前
Check out coursera. UC San Diego just started an entire program full of algo classes.
评论 #11597538 未加载
404error大约 9 年前
I&#x27;m on the same boat as you, don&#x27;t feel bad about it, I feel the same way when I ask for help on StackOverflow. We have to start somewhere right?
kele大约 9 年前
The only thing that comes to my mind might be &quot;Discrete Mathematics&quot; by Ross, Wright. This is quite a heavy book and you don&#x27;t need to go through all of it, but there are some chapters that might be really useful (the one about mathematical induction is probably the most important).<p>Also, I think I can help you a bit. Send me an e-mail at throwawayt52@gmail.com
fahimulhaq大约 9 年前
Look at the free course [A Visual Introduction to Algorithms] (<a href="https:&#x2F;&#x2F;www.educative.io&#x2F;collection&#x2F;10370001&#x2F;760001" rel="nofollow">https:&#x2F;&#x2F;www.educative.io&#x2F;collection&#x2F;10370001&#x2F;760001</a>).<p>Full Disclosure: I&#x27;m a co-founder of Educative. The above course was derived from Khan Academy&#x27;s amazing Algorithms course.
fitzwatermellow大约 9 年前
Still in beta, but Google Code Jam has a new Tutorials section:<p><a href="https:&#x2F;&#x2F;code.google.com&#x2F;codejam&#x2F;tutorials.html" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;codejam&#x2F;tutorials.html</a><p>Start with basic File I&#x2F;O. Then begin working on the beginner level problems. Read the contest analyses when you get stuck. Best of luck! :-)
rajacombinator大约 9 年前
Step one: stop calling yourself a dummy. Step two: learn them.