Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,47 @@
/* NetRexx */
options replace format comments java crossref savelog symbols binary
import java.util.List
placesList = [String -
"UK London", "US New York", "US Boston", "US Washington" -
, "UK Washington", "US Birmingham", "UK Birmingham", "UK Boston" -
]
lists = [ -
placesList -
, insertionSort(String[] Arrays.copyOf(placesList, placesList.length)) -
]
loop ln = 0 to lists.length - 1
cl = lists[ln]
loop ct = 0 to cl.length - 1
say cl[ct]
end ct
say
end ln
return
method insertionSort(A = String[]) public constant binary returns String[]
rl = String[A.length]
al = List insertionSort(Arrays.asList(A))
al.toArray(rl)
return rl
method insertionSort(A = List) public constant binary returns ArrayList
loop i_ = 1 to A.size - 1
value = A.get(i_)
j_ = i_ - 1
loop label j_ while j_ >= 0
if (Comparable A.get(j_)).compareTo(Comparable value) <= 0 then leave j_
A.set(j_ + 1, A.get(j_))
j_ = j_ - 1
end j_
A.set(j_ + 1, value)
end i_
return ArrayList(A)