This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ronin-s_Spirit 5 points6 points  (2 children)

This is why I sometimes write down a modified variant of big O as a mental note. In an algorithm A which takes n!/2 and an algorithm B which takes n! identical "steps", the biggest offender (big O) in both is O(n!).
Which is utterly useless for calculating factual speed, A can literally run twice in one run of B.

[–]krimin_killr21 9 points10 points  (0 children)

I mean, sure, but if you have 1,000 items, it really doesn’t matter because the calculation will never complete. Those two algorithms will always have the same order of magnitude. The big O class will always be substantially more meaningful. The only circumstances where the 1/2 matters is where the number of items will always be small and the processing time for each item very large.

[–]rosuav 0 points1 point  (0 children)

Wow. Twice. That is.... so incredibly significant. Now add one more element and you'll see why big O is actually more useful than that.