Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
/* Based on Rosetta Fortran */
|
||||
Shell_Sort: PROCEDURE (A);
|
||||
DECLARE A(*) FIXED;
|
||||
DECLARE ( i, j, increment) FIXED BINARY (31);
|
||||
DECLARE temp FIXED;
|
||||
|
||||
increment = DIMENSION(a) / 2;
|
||||
DO WHILE (increment > 0);
|
||||
DO i = lbound(A,1)+increment TO hbound(a,1);
|
||||
j = i;
|
||||
temp = a(i);
|
||||
DO WHILE (j >= increment+1 & a(j-increment) > temp);
|
||||
a(j) = a(j-increment);
|
||||
j = j - increment;
|
||||
END;
|
||||
a(j) = temp;
|
||||
END;
|
||||
IF increment = 2 THEN
|
||||
increment = 1;
|
||||
ELSE
|
||||
increment = increment * 5 / 11;
|
||||
END;
|
||||
END SHELL_SORT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue