all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
Procedure Stooge_Sort(Array L.i(1), i=0 , j=0)
|
||||
If j=0
|
||||
j=ArraySize(L())
|
||||
EndIf
|
||||
If L(i)>L(j)
|
||||
Swap L(i), L(j)
|
||||
EndIf
|
||||
If j-i>1
|
||||
Protected t=(j-i+1)/3
|
||||
Stooge_Sort(L(), i, j-t)
|
||||
Stooge_Sort(L(), i+t, j )
|
||||
Stooge_Sort(L(), i, j-t)
|
||||
EndIf
|
||||
EndProcedure
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
Define AmountOfPosts=(?Stop_Data-?Start_data)/SizeOf(Integer)
|
||||
Dim Xyz.i(AmountOfPosts)
|
||||
CopyMemory(?Start_data, @Xyz(), ?Stop_Data-?Start_data)
|
||||
|
||||
Stooge_Sort(Xyz())
|
||||
|
||||
For i=0 To ArraySize(Xyz())
|
||||
Debug Xyz(i)
|
||||
Next i
|
||||
|
||||
DataSection
|
||||
Start_data:
|
||||
Data.i 1, 4, 5, 3, -6, 3, 7, 10, -2, -5, 7, 5, 9, -3, 7
|
||||
Stop_Data:
|
||||
EndDataSection
|
||||
Loading…
Add table
Add a link
Reference in a new issue