Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
cocktail: procedure (A);
|
||||
declare A(*) fixed;
|
||||
declare t fixed;
|
||||
declare stable bit (1);
|
||||
declare (i, n) fixed binary (31);
|
||||
|
||||
n = hbound(A,1);
|
||||
do until (stable);
|
||||
stable = '1'b;
|
||||
do i = 1 to n-1, n-1 to 1 by -1;
|
||||
if A(i) > A(i+1) then
|
||||
do; stable = '0'b; /* still unsorted, so set false. */
|
||||
t = A(i); A(i) = A(i+1); A(i+1) = t;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end cocktail;
|
||||
Loading…
Add table
Add a link
Reference in a new issue