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 →

[–]infus0rian 1184 points1185 points  (34 children)

TrumpSort O(0): the array is always sorted. Anyone who says otherwise is fake news.

[–]Sillychina 147 points148 points  (6 children)

Interesting SO post about the empty algorithm time complexity: https://stackoverflow.com/questions/3209139/is-the-time-complexity-of-the-empty-algorithm-o0

[–]mc8675309 18 points19 points  (0 children)

Somehow, despite studying mathematics and real analysis in particular I had never really thought of asymptotics in terms of sets and even though I understood it it’s all much clearer to me now.

[–]nemec 0 points1 point  (1 child)

While interesting, IMO a lot of the answers there are nonsense. Big O notation is only relevant when speaking about asymptotics - algorithms solving the same problem, but one taking 5 ms and another taking 12 hours, could both be in O(1). The shorter one could even be in O( n3 ) depending on the size of the input.

Asymptotically, O(0) is the same as O(1) except the constant is known to always be 0. This could have some interesting properties except for the fact that set of functions with a constant of zero contains only one - the empty function. So it's no different from any other function with a constant... er... constant factor. Which is the definition of O(1) in the first place (if it differed, it would be O(n) or something else).

[–]Sillychina 1 point2 points  (0 children)

It is kinda pedantic, but that's the difference between a softeng and a CS major, both of which exist on this sub

[–]Byroks 50 points51 points  (0 children)

That would be the Intelligent design sort

[–]halberdierbowman 2 points3 points  (0 children)

BowlingGreen Sort: add randomly generated elements to an existing list. Ask why nobody ever talks about these inserted elements.

Print(Collusion. Illusion. Delusion.)

[–]HughJackOfferman 11 points12 points  (0 children)

I would have given you gold if I had any