1. Engineering
  2. Computer Science
  3. please explain properly with the code...

Question: please explain properly with the code...

Question details
Please explain properly with the code.
ignment%20%20Lab%20 1.pdf Chapter 5: Linked lists A Reference Based Implementation of the ADT List (Page 264 from the book) 1. You need to have the following java files in the project: a. ListDriverClass b. ListInterface c. ListReferenceBased 2. Create a package with the name of ListDriverClass a. Your ListDriverClass contains method main0. b. Your ListDriverClass needs to try different methods in the ListReferenceBased class. 3. Add an interface with the name of Listinterface to the package. Your interface contains the following methods headers: public void add(int newPosition. T newEntry) *t Adds a new entry at a specified position within this list. Entries originally at and above the specified position are at the next higher position within the list The lists size is increased by 1 @param newPosition An integer that specifies the desired position of the new entry @param newEntry The object to be added as a new entry. @ throws IndexOutOfBoundsException if either newPosition < 1 or newPosition > getLength0 + 1. public T remove(int given Position) /* Removes the entry at a given position from this list. Entries originally at positions higher than the giver position are at the next lower position within the list, and the lists size is decreased by 1.
signment%20%20Lab%201.pdf @param givenPosition An integer that indicates the position of the entry to be removed. @return A reference to the removed entry. @throws IndexOutOfBoundsException if either givenPosition 1 or given Position > getLength0. public void removeAllO: * Removes all entries from this list. public T get (int given Position): * Retrieves the entry at a given position in this list. @param givenPosition An integer that indicates the position of the desired entry Greturn A reference to the indicated entry @throws IndexOutOfBoundsException if either givenPosition < 1 or givenPosition > getLengthO.M public int sizeO: * Gets the length of this list. @return The integer number of entries currently in the list. public boolean isEmpty0 * Sees whether this list is empty. @return True if the list is empty, or false if not. 4. Add a class ListReferenceBased to the package. ListReferenceBased class implements the interface ListInterface. 5. In the mainO: a. Create a list with the name of myList b. Try all the methods from LList in the main to make sure they are working properly. For example: Creating a list: LList<String> myList new LList<String 0: Trying the add method: myList.add15); myList.add(25*); myList.add(35): myList.add( 45*);
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution