Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
Procedure insertionSort(Array a(1))
|
||||
Protected low, high
|
||||
Protected firstIndex, lastIndex = ArraySize(a())
|
||||
|
||||
If lastIndex > firstIndex + 1
|
||||
low = firstIndex + 1
|
||||
While low <= lastIndex
|
||||
high = low
|
||||
While high > firstIndex
|
||||
If a(high) < a(high - 1)
|
||||
Swap a(high), a(high - 1)
|
||||
Else
|
||||
Break
|
||||
EndIf
|
||||
high - 1
|
||||
Wend
|
||||
low + 1
|
||||
Wend
|
||||
EndIf
|
||||
EndProcedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue