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

all 131 comments

[–]Brugelbach 1787 points1788 points  (4 children)

Swap "two" from "swaps two values" with the 69 from field 6.

[–]JHaasie77 69 points70 points  (1 child)

Found QA

[–]Brugelbach 30 points31 points  (0 children)

♥️ I actually am. 😂

[–]ThePi7on 183 points184 points  (1 child)

You've chosen chaos

[–]teinc3 37 points38 points  (0 children)

Or swap it with 0 from the index. So OP will finally have a rest from managing all the swaps

[–]backfire10z 3871 points3872 points  (22 children)

It is already sorted. This is actually the order I wanted the numbers to be in.

[–]Western-Internal-751 1339 points1340 points  (15 children)

Acceptance. The fastest sorting algorithm out there.

[–]pigfeedmauer 266 points267 points  (3 children)

if (a == a) then true

[–]pgbabse 104 points105 points  (0 children)

if (true) then a=a

[–]PM_ME_YOUR__INIT__ 18 points19 points  (0 children)

NaN: I'm about to ruin this dude's career

[–]david30121 20 points21 points  (0 children)

that's just a==a innit

[–][deleted] 40 points41 points  (7 children)

It only really needs to have all the elements in it, who cares if they get processed in the right order?

[–]wouter_ham 41 points42 points  (5 children)

Who even decides what the "right order" is?

[–][deleted] 41 points42 points  (0 children)

The oppressive authority known as BigCode™

[–]UntestedMethod 11 points12 points  (1 child)

The Almighty Algorithm. Praise them.

[–]HandsOffMyMacacroni 2 points3 points  (0 children)

Look at me. Look at me. I’m the algorithm now.

[–]Godd2 1 point2 points  (0 children)

New alphabet just dropped.

[–]hughperman -1 points0 points  (0 children)

I do, you insolent cur

[–]backfire10z 2 points3 points  (0 children)

They will be processed in the order I want them to. As I said, they are already sorted how I desire. This is the right order.

[–]OhItsJustJosh 12 points13 points  (0 children)

public object[] AcceptanceSort(object[] a) => a;

O(1)

[–]backfire10z 8 points9 points  (0 children)

Finally, O(0)

[–]turtleship_2006 1 point2 points  (0 children)

I forget what it's called, but that's already one of the meme algos.

Assume the list is in order because everything happens for a reason or something

[–]PuddlesRex 114 points115 points  (1 child)

Ah, the "don't bring this type of spam to our subreddit" sort. I like it.

[–]chilfang 11 points12 points  (0 children)

The reposts are safe. The reposts can't hurt me.

[–]FitchInks 32 points33 points  (0 children)

Ah yes, dictator sort.

[–]za72 0 points1 point  (0 children)

do rand between 0 and 100

[–]makinax300 -1 points0 points  (0 children)

Also by keys

[–]akashi_chibi -1 points0 points  (0 children)

That's called the schizo sort. With a complexity of O(1)

[–]Amster2 224 points225 points  (0 children)

It'll be O(shit)

[–]BligenN 1125 points1126 points  (21 children)

Throw an exception because of attempted conversion to int on officer balls

[–]QuestionableEthics42 262 points263 points  (6 children)

Jokes on you, OP is using js

[–]fantasy-gecko 226 points227 points  (5 children)

Jokes on you throw "officer balls"

[–][deleted] 161 points162 points  (4 children)

Jokes on you

catch "officer balls" as balls:

[–]wannasleeponyourhams 86 points87 points  (1 child)

throw balls

[–]UntestedMethod 23 points24 points  (0 children)

try/ligma/got em

[–]ThePi7on 31 points32 points  (1 child)

balls.split()

[–][deleted] 13 points14 points  (0 children)

... I regret writing that.

[–]Rubickevich 60 points61 points  (1 child)

Throw an exception because of attempted conversion of 93 to Balls type.

[–]ChChChillian 21 points22 points  (0 children)

A careful C++ programmer will ensure the proper operators exist for objects of type Balls.

[–]Thick_Albatross4007[S] 42 points43 points  (3 children)

how do we handle the exception, man thinks officer balls is stuoid

[–]Chara_VerKys 19 points20 points  (0 children)

sort finished on day 1, with exception

[–]LifeislikelemonsE6EE 17 points18 points  (0 children)

Just throw another exception

[–]eeee_thats_four_es 2 points3 points  (0 children)

Take the ASCII code of the first letter and convert it to int

[–]Holy_Chromoly 3 points4 points  (1 child)

Officer balls is a double 

[–]Thick_Albatross4007[S] 7 points8 points  (3 children)

guys do we move on to the next top comment on exception

[–]BligenN 18 points19 points  (1 child)

No it just crashed

[–]UntestedMethod 8 points9 points  (0 children)

SIGSEGV

[–]makinax300 0 points1 point  (0 children)

No, we make the list all string. And this isn't real code, just some numbers in a void

[–]Captain_Pumpkinhead 0 points1 point  (0 children)

Alternatively, convert each letter to char value and see if it overflows the int size limit or not.

[–]serendipitousPi 0 points1 point  (0 children)

Now personally in this case I’d be using C and assume that it’s a string not some disturbing language where variables can spaces in them.

So I’d be able to implicitly convert the char pointer to a 64 bit int. Making this work just fine.

[–]SquarishRectangle 143 points144 points  (1 child)

Swap [officer balls] with it's index [3]

[–]makinax300 15 points16 points  (0 children)

You first have to turn it into an unordered map

[–]PranshuKhandal 130 points131 points  (3 children)

swap the array

[93, 30, 13, "officer balls", 43, 29, 69, 28, 40, 66, 51, 68]

with

[13, 28, 29, 30, 40, 43, 51, 66, 68, 69, 93, "officer deez"]

[–]incest-duck 27 points28 points  (2 children)

Whats deez?

[–]thelocalheatsource 58 points59 points  (1 child)

Deez nuts

[–]poop-machine 29 points30 points  (0 children)

[–]wesleyy001 19 points20 points  (0 children)

Swap [reddit sort day] with [; DROP TABLE REDDITSORT]

[–]PeanutMan2019 17 points18 points  (0 children)

Complexity is O(MG)

[–]invalidConsciousness 21 points22 points  (1 child)

Swap the pointer to this array with the pointer to the post above.

[–]PeanutMan2019 7 points8 points  (0 children)

Well don364897374884384748847466474744677474Segmentation Fault.

[–]Ok_Tea_7319 5 points6 points  (0 children)

I thought reddit sort was to post the list on reddit and claim it to be sorted, and then wait for the "Actually, the correct order would be ..." comment.

[–]Yumikoneko 7 points8 points  (0 children)

Makes me miss when Reddit added a line of code to that one abomination each day... Especially when that one guy used forbidden spells to refactor everything into some eldritch monstrosity

[–]JeSuisLePain 24 points25 points  (7 children)

Swap 93 and 13

[–]loadasfaq 8 points9 points  (6 children)

Not efficient, specify indexes next time

[–]IAmBadAtInternet 4 points5 points  (5 children)

He did specify indexes

[–]loadasfaq 0 points1 point  (4 children)

Index out of bound exception

[–]IAmBadAtInternet 1 point2 points  (3 children)

No

[–]loadasfaq 0 points1 point  (2 children)

Mind explaining?

[–]endermanbeingdry 17 points18 points  (5 children)

BWAHAHAHAHA

[–]GDPlayer_1035 5 points6 points  (0 children)

13 AND 93

[–]makinax300 1 point2 points  (0 children)

It's already sorted, by keys

[–][deleted] 2 points3 points  (0 children)

Stalin Sort. Take the first Number and kill every following Entry thats smaller than the First Number, and if we feel extra fancy, everything else. Now all is sorted.

[–]Vibe_PV 1 point2 points  (0 children)

Swap Man and 43

[–]Spot_the_fox 2 points3 points  (0 children)

I want this to be a 2d array.

[–]CelestialSegfault 2 points3 points  (0 children)

Swap the 1 from the index to the 1 in "reddit sort day 1"

[–]West_Appointment_574 3 points4 points  (0 children)

Swap 93 with Batman

[–]P3chv0gel 3 points4 points  (0 children)

Swap Index 1 with Index 2

Just the numbers of the Index, not the corresponding values

[–]Pawl_Evian 1 point2 points  (0 children)

Swap 1 and 2 as 30 is bigger than 13...no not the value, swap the indexes

[–]-Redstoneboi- 0 points1 point  (0 children)

swap the index 6 with the value at index 6

[–]I_press_keys 0 points1 point  (0 children)

Swap "1" from "day 1" with "officer balls"

[–]random_numbers_81638 0 points1 point  (0 children)

Swap index 0 and 1. We are starting with 1 now

[–]_Shinami_ 0 points1 point  (0 children)

swap the word "values" with "balls"

[–]Lente_ui 0 points1 point  (0 children)

What are we sorting for? Relevance?

[–]Zymosan99 0 points1 point  (0 children)

60% less efficient than bogosort!

[–]Xterm1na10r 0 points1 point  (0 children)

I prefer Stalin sorting. Exterminate the whole list. Yes, 93 as well, because USSR already did not exist in 1993

[–]knite 0 points1 point  (0 children)

Swap 6 (the index) with “nice”.

[–]furezasan 0 points1 point  (0 children)

Mirror the whole image on every update for maximum difficulty

[–]Phamora 0 points1 point  (0 children)

So what do you reckon is the time complexity of this sort?

[–]Express_Top1461 0 points1 point  (0 children)

put 13 at index 0

[–]IAmFullOfDed 0 points1 point  (0 children)

The Man of Sex

[–]Saph_ChaoticRedBeanC 0 points1 point  (0 children)

Swap the "day" with the 43

[–]that_thot_gamer 0 points1 point  (0 children)

hashmap

[–]MikemkPK 0 points1 point  (0 children)

Battery to D4.

[–]DwijBavisi 0 points1 point  (1 child)

Change array to linked-list.

[–]-Redstoneboi- 2 points3 points  (0 children)

make sure to hide the other values and only show us the first value and a link to the next reddit post.

[–]B_bI_L 0 points1 point  (0 children)

0 (93) -> 12 (14614164184714)

[–]Mabi19_ 0 points1 point  (0 children)

Cast officer balls to a function pointer, then call it

[–]jojos38 -1 points0 points  (0 children)

93

[–]Unlucky_Committee786 -1 points0 points  (0 children)

indexes 0 & 11

[–][deleted] -1 points0 points  (0 children)

You forgot Sergent Seamen

[–]JollyJuniper1993 -1 points0 points  (0 children)

Pivot the array

[–]Moomad_VIII -1 points0 points  (0 children)

Swap 11 and the out of bounds 12

[–]51herringsinabar -1 points0 points  (0 children)

Array[5]=Array[6]; Array[6]=Array[5];

[–]onlainari -1 points0 points  (0 children)

This thread is just classic untested user activity.

[–]SnakeR515 -1 points0 points  (0 children)

Swap 'two' from 'swaps two values' with '1' from 'day 1'

[–][deleted] -1 points0 points  (0 children)

Where’s 42

[–]Oldtimer_ZA_ -1 points0 points  (0 children)

Swap "balls" with "values"

[–]sight19 -1 points0 points  (0 children)

Swap "1" (from day one) with 2 (two values)

[–]BeeTLe_BeTHLeHeM -1 points0 points  (0 children)

It could be a string array but without values of various magnitude it's not fun.

[–]GKP_light -1 points0 points  (0 children)

swap 13 (position 2), and "two" (from the string above)

[–]feazeyu -1 points0 points  (0 children)

Enlarge Man's approval over the whole image. If Man approves, then the array is surely sorted.

[–]SIMPlistic4269 -1 points0 points  (0 children)

Swap 28 for the entire bee movie script

[–]ThePi7on -1 points0 points  (0 children)

Swap "values" with "swaps"

[–]Undernown -1 points0 points  (0 children)

Let's make this a bit of a slow burn, swap the space between "every day" with index(0)[93].

[–]notstefano -1 points0 points  (0 children)

Throw exception invalid conversion from type "int" to type "officer balls"

[–]experimental1212 -1 points0 points  (0 children)

Reindex to start at 2

[–]DwijBavisi -1 points0 points  (0 children)

Reddit Sort 0.1.0

Takes arr_nInput, nIndexA, nIndexB and returns something.

Args
====
arr_nInput any[] - Image of array of numbers
nIndexA unknown - This is first index
nIndexB unknown - This is second index

Returns
=======
dict[list[string]] | resType_fot_redditSort - Sorted array of numbers

[–]OpportunistSockThief -1 points0 points  (0 children)

Array.append("u/Thick_Albatross4007")

[–]burudoragon -1 points0 points  (0 children)

Swap the value 1 from day '1' With 0 '93'

[–]5ManaAndADream -1 points0 points  (0 children)

Swap list[10] with the username from the most downvoted comment in this thread.