Sorting algorithms/Radix sort: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 3,079:
END SUB
</lang>
 
=={{header|Quackery}}==
 
<lang Quackery> [ stack ] is digit ( --> s )
 
[ behead swap witheach min ] is smallest ( [ --> n )
 
[ [] over smallest
rot witheach
[ over -
rot swap join swap ]
swap
0 digit put
dup size temp put
[ ' [ [ ] ] 16 of swap
witheach
[ dup dip
[ digit share
>> 15 &
2dup peek ]
join
unrot poke ]
dup 0 peek size
temp share != while
behead swap
witheach join
4 digit tally again ]
behead nip
temp release
digit release
[] unrot
witheach
[ over +
rot swap join swap ]
drop ] is radixsort ( [ --> [ )
 
[] 256 times
[ 1999 random 999 - join ]
radixsort
16 times
[ 16 times
[ behead
dup 0 > if sp
dup abs dup
10 < if sp
100 < if sp
echo sp ] cr ]
drop</lang>
 
{{out}}
 
<pre>-992 -984 -982 -962 -957 -952 -921 -907 -906 -906 -903 -874 -870 -864 -861 -858
-852 -852 -844 -836 -835 -823 -804 -804 -802 -800 -794 -791 -789 -786 -778 -770
-766 -759 -754 -752 -744 -743 -743 -718 -716 -695 -685 -683 -680 -677 -672 -670
-669 -644 -643 -640 -639 -639 -623 -603 -601 -589 -588 -575 -572 -567 -565 -557
-554 -542 -535 -531 -527 -518 -515 -501 -475 -474 -457 -420 -411 -386 -377 -376
-371 -367 -350 -348 -347 -346 -332 -314 -301 -301 -299 -293 -285 -272 -242 -239
-237 -234 -230 -225 -225 -196 -188 -163 -147 -146 -145 -143 -125 -121 -119 -116
-110 -108 -105 -104 -97 -85 -71 -69 -66 -58 -52 -40 -25 -9 -8 14
23 44 45 49 67 69 83 87 87 127 138 143 145 159 160 166
168 169 178 187 204 218 220 231 231 232 235 237 244 251 255 258
264 265 272 285 287 300 314 337 341 348 351 353 359 367 370 372
376 398 402 410 415 420 443 464 465 474 479 483 516 519 520 541
543 546 552 558 559 561 565 579 596 607 616 637 668 668 679 682
698 698 714 720 728 734 736 744 768 768 789 789 797 797 799 802
802 814 815 815 819 833 841 844 848 862 868 885 887 890 894 906
912 927 930 933 936 946 947 950 955 963 967 968 969 969 989 999
</pre>
 
=={{header|Racket}}==
1,462

edits