News for hackers. Stuff that matters.
Re:Three of the Hundred Falsehoods CS Students Believe by Doxin on Monday November 11, 2019 @07:07AM (#21504104)
For me the most useful skill has been to recognise when I'm doing something that's O(n^2) or worse, especially if it involves doing anything besides just math (e.g. database queries, file reads, web requests, etc) If something is O(n^2) or worse it's a good sign I should probably google around for a better algorithm.

Thankfully python has a rich set of built in datastructures, using a dict (or a hash map in other languages) turns a lot of O(n) problems into O(1) problems. The bisect module turns O(n) problems into O(n log n) problems. I'm always keeping my eye out for more of these big-o-reducers.

That said, in production software it hardly ever matters these days as long as you're not doing anything exceedingly daft. Fast enough is fast enough.

There are no comments on this comment yet.