all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,17 @@
stoogesort: procedure (L) recursive; /* 16 August 2010 */
declare L(*) fixed binary;
declare (i, j, t, temp) fixed binary;
j = hbound(L,1);
do i = lbound(L, 1) to j;
if L(j) < L(i) then
do; temp = L(i); L(i) = L(j); L(j) = temp; end;
if j - i > 1 then
do;
t = (j - i + 1)/3;
call stoogesort(L, i , j-t);
call stoogesort(L, i+t, j );
call stoogesort(L, i , j-t);
end;
end;
end stoogesort;