Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
;sorts an array of integers
|
||||
Procedure combSort11(Array a(1))
|
||||
Protected i, gap, swaps = 1
|
||||
Protected nElements = ArraySize(a())
|
||||
|
||||
gap = nElements
|
||||
While (gap > 1) Or (swapped = 1)
|
||||
gap * 10 / 13
|
||||
If gap = 9 Or gap = 10: gap = 11: EndIf
|
||||
If gap < 1: gap = 1: EndIf
|
||||
|
||||
i = 0
|
||||
swaps = 0
|
||||
While (i + gap) <= nElements
|
||||
If a(i) > a(i + gap)
|
||||
Swap a(i), a(i + gap)
|
||||
swaps = 1
|
||||
EndIf
|
||||
i + 1
|
||||
Wend
|
||||
Wend
|
||||
EndProcedure
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
;sorts an array of integers
|
||||
Procedure combSort(Array a(1))
|
||||
Protected i, gap, swaps = 1
|
||||
Protected nElements = ArraySize(a())
|
||||
|
||||
gap = nElements
|
||||
While (gap > 1) Or (swaps = 1)
|
||||
gap = Int(gap / 1.25)
|
||||
|
||||
i = 0
|
||||
swaps = 0
|
||||
While (i + gap) <= nElements
|
||||
If a(i) > a(i + gap)
|
||||
Swap a(i), a(i + gap)
|
||||
swaps = 1
|
||||
EndIf
|
||||
i + 1
|
||||
Wend
|
||||
Wend
|
||||
EndProcedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue