[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

can we ever do better lads?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 18
Thread images: 3

File: canwe.png (65KB, 1177x520px) Image search: [Google]
canwe.png
65KB, 1177x520px
can we ever do better lads?
>>
>>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.
>>
File: never change.jpg (39KB, 618x540px) Image search: [Google]
never change.jpg
39KB, 618x540px
>>
>>60235502
js
Thread posts: 18
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.