>>60233861
sleepsort is one of those genuinely magic things that can never be surpassed
it's extremely elegant in how awful it is
Wow... this was the first post ever on /g/?
>>60233955
this is actually /prog/
what
>>60233955
>Wow... this was the first post ever on /g/?
>post from 2011
Kys
i can probably just modify it by having a timer that goes up and iterates through the array each count to see if the number is included
>>60233955
lmao, you are fucking retarded
kill yourself
bogo sort OP
>>60233955
yes
Go through all values first.
Keep track of of biggest, smallest, and amount of values.
Sleep for (biggest-smallest)/amount)*value
maybe also take into account time it takes until all sleeps are set.
Scale the size of the input down while sorting then scale them all up again when returning?
>>60234523
Bongo sort
function sortx (s) {
var i, r = [];
for (i = 0; i < s.length; i++) {
r[s[i]] = 1;
}
for ( i = r.length - 1; i >= 0; i-- ) {
r[i] && console.log(i);
}
}
sortx([3,1,4,15,9,2,6,5]);
guaranteed n-time, whether best, average, or worst case scenario. :^)
>>60235419
what language is this
>>60235502
If I had to guess, javascript because of the typeless variable declaration (var i, r), and the console.log() seems like javascript.