Assignment: #IntList Due: 03/04/2017 Points: 5

Specification

Copy the program IntList.java and implement the methods that have "TBI (To Be Implemented)" in their respective method comment blocks.

Numerous class IntList methods have been implemented, but the following following are the methods that need to be implemented for this assignment.

   public void growIntList();
   public int car(); 
   public IntList cdr(); 
   public int search();
   public boolean equals();
   public boolean delete();

The "TBI (To Be Implemented)" methods are documented in their respective method command blocks.

class IntList is an array-based implementation of a List data structure. It is necessary to read the existing code in order to understand what can be done with IntList objects.

The output of your program must match the following. The already coded main() method should not need any modifications.

list (before adds): ()
isEmpty() = true; size() = 0; capacity() = 4
...4 added
...-3 not added
...0 added
...9 added
...-8 not added
...0 added
...7 added
...0 added
list (after adds): (4 0 9 0 7 0)
isEmpty() = false; size() = 6; capacity() = 8
car(4 0 9 0 7 0) = 4
cdr(4 0 9 0 7 0) = (0 9 0 7 0)
car(0 9 0 7 0) = 0
cdr(0 9 0 7 0) = (9 0 7 0)
car(9 0 7 0) = 9
cdr(9 0 7 0) = (0 7 0)
car(0 7 0) = 0
cdr(0 7 0) = (7 0)
car(7 0) = 7
cdr(7 0) = (0)
car(0) = 0
cdr(0) = ()
search(4) found at index 0
search(-3) not found
search(0) found at index 1...3...5
search(9) found at index 2
search(-8) not found
search(0) found at index 1...3...5
search(7) found at index 4
search(0) found at index 1...3...5
(4 0 9 0 7 0).equals(4 0 9 0 7 0) = true
(4 0 9 0 7 0).equals(0 9 0 7 0) = false
list (before deletes): (4 0 9 0 7 0)
...4 deleted (0 9 0 7 0)
...-3 not found (0 9 0 7 0)
...0 deleted (9 0 7 0)
...9 deleted (0 7 0)
...-8 not found (0 7 0)
...0 deleted (7 0)
...7 deleted (0)
...0 deleted ()
list (after deletes): ()
instantiate a negative capacity IntList...
java.lang.IllegalArgumentException: 
*** capacity must be > 0