Question: On Page 258, Section 7.1, implement the List ADT. That means implementing all the 6 functions and run your code on Example 7.1 on page

On Page 258, Section 7.1, implement the List ADT. That means implementing all the 6 functions and run your code on Example 7.1 on page 259. Your program should print out that table in Example 7.1. Please code in JAVA
Example 7.1: We demonstrate operations on an initially empty list of characters. /** A simplified version of the java.util.List interface. */ public interface List E> \{ /** Returns the number of elements in this list. */ int size() /** Returns whether the list is empty. */ boolean isEmpty(); / Returns (but does not remove) the element at index i. */ E get(int i) throws IndexOutOfBoundsException; / Replaces the element at index i with e, and returns the replaced element. / E set(int i, E e) throws IndexOutOfBoundsException; /** Inserts element e to be at index i, shifting all subsequent elements later. */ void add(int i, E e) throws IndexOutOfBoundsException; /** Removes/returns the element at index i, shifting subsequent elements earlier. */ E remove(int i) throws IndexOutOfBoundsException; \} Code Fragment 7.1: A simple version of the List interface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
