Author of OP needs to read <a href="https://math.stackexchange.com/q/4252237/3124" rel="nofollow">https://math.stackexchange.com/q/4252237/3124</a>
The issue wasn’t algorithm complexity but algorithm behavior. Author definitely has learned something about promoting articles, has not apparently learned or thought about software performance.<p>The constant factors also play a huge role, as the author found out. Do you want a car that takes 2 hours to warm up and then accelerates to 200mph in 5 seconds, or a car that goes 0-60 in 10 seconds and tops out there? Depends on how far you’re going.<p>I’m not sure I’d want to hire them after reading this, but a piece about how big O isn’t the full picture would get sympathy.
Big-O isn't a lie. The utility of Big-O is a lie.<p>Students are told that cyclomatic complexity of algorithms is the be-all and end-all of performance. They're trying to replace the student's intuitive idea that opcode-level optimization is the be-all and end-all of performance.<p>In practice, performance rarely depends on either of those. And performance as a measure of merit -- either the program's or the programmer's -- is also rarely the most important thing.<p>Big-O is taught because it's a thing you can teach. Students need to practice writing programs, and fundamental algorithms have the advantage that they don't require either domain expertise or knowledge of any particular framework. They get to practice writing code using just the language they've learned, with a simplistic goal like putting data in order.<p>That's also the reason it shows up in so many interviews. It's easy to test and objective. And it feels important, even though it's almost never a tool you'll use in real life as a programmer.
Great clickbait title :)<p>Big-O is a way to class algorithms/methods into similar categories<p>It is distinctly <i>NOT</i> a profiling tool!<p>O(n) is [almost] always better than O(n2)<p>Likewise, O(logN) is [almost] always better than O(n)<p>But just because you're comparing within rough categories doesn't mean they're the <i>same</i><p>Crab apples are apples<p>Just like Northern Spies<p>But other than being "apples" ... they're nothing alike - one is about an inch in diameter, the other 3-4". One's crisp, solid, and mildly sweet-tart...the other is practically uneatable without tons of sugar<p>But they're not bananas<p>And that's what Big-O is all about - putting the <i>classes</i> or <i>types</i> of algorithms into groups<p>Sounds like the author had no clue what he was being told in college (which is concerning ... it's something I had explained by every compsci and infosys instructor and professor I had over the course of dozens of classes)