Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
code ChOut=8, IntOut=11; \intrinsic routines
|
||||
|
||||
proc StoogeSort(L, I, J); \Sort array L
|
||||
int L, I, J;
|
||||
int T;
|
||||
[if L(J) < L(I) then
|
||||
[T:= L(I); L(I):= L(J); L(J):= T]; \swap
|
||||
if J-I > 1 then
|
||||
[T:= (J-I+1)/3;
|
||||
StoogeSort(L, I, J-T);
|
||||
StoogeSort(L, I+T, J);
|
||||
StoogeSort(L, I, J-T);
|
||||
];
|
||||
];
|
||||
|
||||
int A, I;
|
||||
[A:= [3, 1, 4, 1, -5, 9, 2, 6, 5, 4];
|
||||
StoogeSort(A, 0, 10-1);
|
||||
for I:= 0 to 10-1 do [IntOut(0, A(I)); ChOut(0, ^ )];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue