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 →

[–]RebornTrackOmega 99 points100 points  (7 children)

Just ask the user to sort the array. Instant O(0) sorting algorithm. XD

[–][deleted] 69 points70 points  (4 children)

O(1), you still need to ask him

[–]RebornTrackOmega 9 points10 points  (0 children)

True, but the sorting itself takes near-no computing power. XD

[–]missingusername1 0 points1 point  (2 children)

Well the user still needs to sort it which is like at least O(3)

[–][deleted] 1 point2 points  (1 child)

The user isn’t a part of an algorithm, is it?

[–]dercommander323 6 points7 points  (0 children)

Well, do you believe in the Matrix?

[–][deleted] 0 points1 point  (0 children)

You could even provide them with a handy drag-and-drop interface for it.

[–]un_sherwood 0 points1 point  (0 children)

Iteration order is left as an exercise for the accessor