Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
DIM test%(9)
|
||||
test%() = 4, 65, 2, -31, 0, 99, 2, 83, 782, 1
|
||||
PROCstoogesort(test%(), 0, DIM(test%(),1))
|
||||
FOR i% = 0 TO 9
|
||||
PRINT test%(i%) ;
|
||||
NEXT
|
||||
PRINT
|
||||
END
|
||||
|
||||
DEF PROCstoogesort(l%(), i%, j%)
|
||||
LOCAL t%
|
||||
IF l%(j%) < l%(i%) SWAP l%(i%), l%(j%)
|
||||
IF j% - i% > 1 THEN
|
||||
t% = (j% - i% + 1)/3
|
||||
PROCstoogesort(l%(), i%, j%-t%)
|
||||
PROCstoogesort(l%(), i%+t%, j%)
|
||||
PROCstoogesort(l%(), i%, j%-t%)
|
||||
ENDIF
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue