Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols binary
|
||||
|
||||
iList = [int 1, 4, 5, 3, -6, 3, 7, 10, -2, -5, 7, 5, 9, -3, 7]
|
||||
sList = Arrays.copyOf(iList, iList.length)
|
||||
|
||||
sList = stoogeSort(sList)
|
||||
|
||||
lists = [iList, sList]
|
||||
loop ln = 0 to lists.length - 1
|
||||
cl = lists[ln]
|
||||
rpt = Rexx('')
|
||||
loop ct = 0 to cl.length - 1
|
||||
rpt = rpt cl[ct]
|
||||
end ct
|
||||
say '['rpt.strip().changestr(' ', ',')']'
|
||||
end ln
|
||||
|
||||
return
|
||||
|
||||
method stoogeSort(L_ = int[], i_ = 0, j_ = L_.length - 1) public static returns int[]
|
||||
|
||||
if L_[j_] < L_[i_] then do
|
||||
Lt = L_[i_]
|
||||
L_[i_] = L_[j_]
|
||||
L_[j_] = Lt
|
||||
end
|
||||
if j_ - i_ > 1 then do
|
||||
t_ = (j_ - i_ + 1) % 3
|
||||
L_ = stoogeSort(L_, i_, j_ - t_)
|
||||
L_ = stoogeSort(L_, i_ + t_, j_)
|
||||
L_ = stoogeSort(L_, i_, j_ - t_)
|
||||
end
|
||||
|
||||
return L_
|
||||
Loading…
Add table
Add a link
Reference in a new issue