Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,16 +1,16 @@
|
|||
StoogeSort(L, i:=1, j:=""){
|
||||
if !j
|
||||
j := L.MaxIndex()
|
||||
if (L[j] < L[i]){
|
||||
temp := L[i]
|
||||
L[i] := L[j]
|
||||
L[j] := temp
|
||||
}
|
||||
if (j - i > 1){
|
||||
t := floor((j - i + 1)/3)
|
||||
StoogeSort(L, i, j-t)
|
||||
StoogeSort(L, i+t, j)
|
||||
StoogeSort(L, i, j-t)
|
||||
}
|
||||
return L
|
||||
if !j
|
||||
j := L.MaxIndex()
|
||||
if (L[j] < L[i]){
|
||||
temp := L[i]
|
||||
L[i] := L[j]
|
||||
L[j] := temp
|
||||
}
|
||||
if (j - i > 1){
|
||||
t := floor((j - i + 1)/3)
|
||||
StoogeSort(L, i, j-t)
|
||||
StoogeSort(L, i+t, j)
|
||||
StoogeSort(L, i, j-t)
|
||||
}
|
||||
return L
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ MsgBox % map(StoogeSort([123,51,6,73,3,-12,0]))
|
|||
return
|
||||
|
||||
map(obj){
|
||||
for k, v in obj
|
||||
res .= v ","
|
||||
return trim(res, ",")
|
||||
for k, v in obj
|
||||
res .= v ","
|
||||
return trim(res, ",")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue