CISC 3115
Introduction to Modern Programming Techniques
ArrayList

Lab 8 — Working with an ArrayList (ArrayListApp)

Write an ArrayListApp class that plays with an ArrayList. The app should: Here is the API for ArrayList

Here is the expected output (for CodeLab):

Playing with an ArrayList containing 10 numbers in the range of 0..20

Before sorting
[11, 0, 1, 8, 15, 4, 15, 2, 1, 9]
After sorting
[0, 1, 1, 2, 4, 8, 9, 11, 15, 15]

0 is in the list
1 is in the list
2 is in the list
3 is not in the list
4 is in the list
5 is not in the list
6 is not in the list
7 is not in the list
8 is in the list
9 is in the list
10 is not in the list
11 is in the list
12 is not in the list
13 is not in the list
14 is not in the list
15 is in the list
16 is not in the list
17 is not in the list
18 is not in the list
19 is not in the list

[0, 1, 1, 2, 4, 8, 9, 11, 15, 15]
Removing from front
removed 0: [1, 1, 2, 4, 8, 9, 11, 15, 15]
removed 1: [1, 2, 4, 8, 9, 11, 15, 15]
removed 1: [2, 4, 8, 9, 11, 15, 15]
removed 2: [4, 8, 9, 11, 15, 15]
removed 4: [8, 9, 11, 15, 15]
removed 8: [9, 11, 15, 15]
removed 9: [11, 15, 15]
removed 11: [15, 15]
removed 15: [15]
removed 15: []

[0, 1, 1, 2, 4, 8, 9, 11, 15, 15]
Removing from rear
removed 15: [0, 1, 1, 2, 4, 8, 9, 11, 15]
removed 15: [0, 1, 1, 2, 4, 8, 9, 11]
removed 11: [0, 1, 1, 2, 4, 8, 9]
removed 9: [0, 1, 1, 2, 4, 8]
removed 8: [0, 1, 1, 2, 4]
removed 4: [0, 1, 1, 2]
removed 2: [0, 1, 1]
removed 1: [0, 1]
removed 1: [0]
removed 0: []

Files Relevant to this Lab