Commit 5ac23b97 authored by daidekun's avatar daidekun

subList

parent e2390bf6
......@@ -19,12 +19,13 @@ def partition(array, size) {
def partList(al, fromIndex, size) {
print "Original ArrayList Content: "+al
partOne = al.subList(0, fromIndex)
partOne = new ArrayList<String>(al.subList(0, fromIndex))
print "SubList stored in partOne: "+partOne
partTwo = al.subList(fromIndex, size)
partOne = new ArrayList<String>(al.subList(fromIndex, size))
print "SubList stored in partTwo: "+partTwo
return [partOne, partTwo]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment