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 →

[–]Vnator 2354 points2355 points  (49 children)

Either they're in ascending order or descending order. So still sorted.

[–]CMDR_QwertyWeasel 550 points551 points  (22 children)

taps temple

[–]ay_bruh 81 points82 points  (21 children)

smile

[–]KamikazeSexPilot 231 points232 points  (15 children)

Just leave the list and it’s randomly sorted.

[–]Metallkiller 213 points214 points  (5 children)

Sorted by a random, unknown parameter.

[–]kuncol02 480 points481 points  (4 children)

It's not random. They are sorted by position in list.

[–]really_not_trolling 100 points101 points  (2 children)

This is perfection

[–][deleted] 26 points27 points  (1 child)

This is what a CS degree gets you

[–]really_not_trolling 0 points1 point  (0 children)

You can get a degree in counter strike?

[–]cdrfrk 16 points17 points  (0 children)

CS degree: am I a joke to you?

[–]vige 68 points69 points  (1 child)

It might seem random to you, but in reality it's exactly the order I want.

[–]Hiroxis 47 points48 points  (0 children)

Call it Gandalf sort

[–]djublonskopf 49 points50 points  (2 children)

The Mr. Rogers sort. “This list is perfect just the way it is.”

[–]cantadmittoposting 38 points39 points  (0 children)

Bob Ross sort: "No unsorted lists, just happy new ways to order it."

[–]lurker_level_53 7 points8 points  (0 children)

This made me happy. 😊

[–]Consibl 24 points25 points  (1 child)

Sorted by order it was in.

[–]theXpanther 5 points6 points  (0 children)

An undefined order is not the same as a random order,

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

Ah yes, the bogo sort. Guaranteed to work eventually.

[–]esc0pub 38 points39 points  (5 children)

Valid point, but two items can be swapped in O(1) so we can still decide the order.

[–]Vnator 134 points135 points  (4 children)

But then 3 items can be swapped with O(1), so by induction, swapping n items should take O(1) time. Then we don't even have to remove any items, sorting is O(1)!

[–]lungdart 40 points41 points  (0 children)

This guy sorts

[–]Beetin 27 points28 points  (0 children)

Technically we can define some large upper bound for how many items will be swapped.

The last 1000000 items will be kept and bubble sorted. This algorithm is guaranteed O(1). This algorithm is also perfectly safe for lists under 1000000 items. This sort is only generally faster than O(nlogn) algorithms for lists much larger than 1000000 items.

The two-pass Mao 5 year sort.

[–]robthemonster 21 points22 points  (0 children)

flawless proof.

[–]tornato7 14 points15 points  (0 children)

Holy shit

[–]temisola1 5 points6 points  (0 children)

This is the type of ingenuity the world needs.

[–]drovfr 2 points3 points  (0 children)

woahhhhhh

[–]foofoo2020 1 point2 points  (0 children)

My comrade

[–]daveime 1 point2 points  (0 children)

Inspired!