Genius sorting algorithm: Sleep sort
1
Name:
Anonymous
2011-01-20 12:22
Man, am I a genius. Check out this sorting algorithm I just invented.
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shift
done
wait
example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7
1001
Name:
echo
2011-07-22 5:44
<p><a href="
http://www.onepearls.com ">wholesale pearl jewelry</a></p>
1002
Name:
Over 1000 Thread
2011-07-22 5:44
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1003
Name:
Anonymous
2012-01-27 0:16
gdfsg
1004
Name:
Over 1000 Thread
2012-01-27 0:16
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1005
Name:
Anonymous
2012-01-27 3:51
But I can!
1006
Name:
Over 1000 Thread
2012-01-27 3:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1007
Name:
Anonymous
2012-01-27 3:51
umad moot
1008
Name:
Over 1000 Thread
2012-01-27 3:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1009
Name:
Anonymous
2012-01-27 3:51
umad moot
1010
Name:
Over 1000 Thread
2012-01-27 3:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1011
Name:
Anonymous
2012-01-27 3:51
umad moot
1012
Name:
Over 1000 Thread
2012-01-27 3:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1013
Name:
Anonymous
2012-01-27 3:51
umad moot
1014
Name:
Over 1000 Thread
2012-01-27 3:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1015
Name:
Anonymous
2012-01-27 3:52
umad moot
1016
Name:
Over 1000 Thread
2012-01-27 3:52
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1017
Name:
Anonymous
2012-01-27 3:52
umad moot
1018
Name:
Over 1000 Thread
2012-01-27 3:52
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1019
Name:
Anonymous
2012-01-27 4:27
Fick Ja sleep sort
1020
Name:
Over 1000 Thread
2012-01-27 4:27
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1021
Name:
Anonymous
2012-01-27 8:58
one of the best threads in /prog/ is dying thanks to spammer. long live the mods!
1022
Name:
Over 1000 Thread
2012-01-27 8:58
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1023
Name:
Anonymous
2012-01-27 9:01
1024
Name:
Over 1000 Thread
2012-01-27 9:01
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1025
Name:
Anonymous
2012-01-27 9:25
>>1021
Yeah. It is a sad day truly.
1026
Name:
Over 1000 Thread
2012-01-27 9:25
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1027
Name:
Burgeron
2012-01-27 9:47
This is basically bucket sort behind the scenes.
However, it reminded me that my FPGA with nanosecond accurate clock could sort the numbers 0 to 4'294'967'296 in 4.3 seconds... if it had enough RAM...
1028
Name:
Over 1000 Thread
2012-01-27 9:47
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1029
Name:
Anonymous
2012-02-10 7:33
jur
1030
Name:
Over 1000 Thread
2012-02-10 7:33
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1031
Name:
TheShadowFog
!WuvOsumF7w
2012-02-10 9:11
1032
Name:
Over 1000 Thread
2012-02-10 9:11
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1033
Name:
Anonymous
2012-02-10 9:20
lolololol
1034
Name:
Over 1000 Thread
2012-02-10 9:20
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1035
Name:
Anonymous
2012-02-10 10:26
Huh.
1036
Name:
Over 1000 Thread
2012-02-10 10:26
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1037
Name:
TheShadowFog
!WuvOsumF7w
2012-02-10 10:35
1038
Name:
Over 1000 Thread
2012-02-10 10:35
Over 1000
This thread has over 1000 replies. You can't reply anymore.
1039
Name:
test
2012-02-10 10:51
test
1040
Name:
Over 1000 Thread
2012-02-10 10:51
Over 1000
This thread has over 1000 replies. You can't reply anymore.
Newer Posts