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.

Plain english explanation of Big O

155 pointsby alrex021almost 15 years ago

9 comments

jacquesmalmost 15 years ago
That's a very clear and accessible explanation of what big O complexity is all about.<p><i>But</i> (and that's a pretty big but), 'Big O' is not all there is, and once you've picked your algorithm based on the one that has the best expected runtime based on 'Big O', you <i>really</i> have to try to make sure that:<p><pre><code> - your algorithm is executed with the lowest possible frequency - you concentrate on those pesky n's that you eliminated during analysis to make sure that you don't end up wasting all your CPU time on some little detail somewhere - you take in to account the effects of your code on caches and virtual memory - you profile your code afterwards to make sure that all your assumptions regarding the above are correct </code></pre> It is very easy to pick the 'right' algorithm and still get crappy runtime if you skip those steps.
评论 #1520813 未加载
评论 #1521029 未加载
评论 #1520902 未加载
steamboileralmost 15 years ago
Interestingly the top rated answer was given by the gentleman who got turned down by Google<p><a href="http://news.ycombinator.com/item?id=1520323" rel="nofollow">http://news.ycombinator.com/item?id=1520323</a>
评论 #1520989 未加载
gzalmost 15 years ago
Knuth's take: <a href="http://micromath.wordpress.com/2008/04/14/donald-knuth-calculus-via-o-notation/" rel="nofollow">http://micromath.wordpress.com/2008/04/14/donald-knuth-calcu...</a>
ajalmost 15 years ago
Really good and simple explanation. Elegant examples to illustrate his points as well.
beza1e1almost 15 years ago
Understand the effect of the constant factor hidden within the Big O. Often a O(n) algorithm is faster than a O(1) algorithm, because n is too small. E.g. arrays vs hashmaps.<p>Make sure what n is in each case. For example a graph algorithm with O(n^2) and n being the number of nodes may actually be O(n) for n being the graph size (number of edges).
erikpukinskisalmost 15 years ago
Apparently computational complexity is no longer the first thing that comes to mind when I read "Big O".
d0malmost 15 years ago
It starts with: "The simplest explanation" - and it goes on and on for 5 pages.
评论 #1523090 未加载
zandorgalmost 15 years ago
A friend of mine at University said the only true 'Big O' is Roy Orbison.
autarchalmost 15 years ago
That anime was <i>really</i> confusing. I'm not sure I could come up with a simple plain English explanation.<p>Was it a dream? A computer simulation? An alternate reality? I mean, really, wtf?