Question: The implementation of the Generic SinglyLinked List that was covered in class is missing some important operations. Complete the implementation by proving the code

The implementation of the Generic SinglyLinked List that was covered in classis missing some important operations. Complete the implementation by proving the codefor the methods described below. Test your code to make sure that

The implementation of the Generic SinglyLinked List that was covered in class is missing some important operations. Complete the implementation by proving the code for the methods described below. Test your code to make sure that your List is working properly. The complete design of the class is shown below: SinglyLinkedList -head: Node -tail: Node -size: int +SingleLinkedList() +length(): int +isEmpty(): boolean +getFirst(): E +getLast(): E +addFirst(e: E): void +addLast(e: E): void +removeFirst(): E +get(n: int): E +insertAfter(n: int, e: E): void +delete(n: int): void -head -tail Node +element: E +next: Node +Node(e: E, n: Node ) +getElement(): E +getNext(): Node +setNext(n: Node ): void E removeLast() Remove the last element from the List and return it. If the List is empty, return null. E get (int n) Return the nth element of the List. The first element is number 0. If n length(), return null. void insertAfter(int n, E e) Insert the element e after the nth element of the List. If n length(), do not insert the element. No error is returned or exception raised. void delete(int n) Remove the nth element of the List (including n=0). If n length(), do not delete an element. No error is returned or exception raised. When your implementation is complete, run it with the test driver Enhanced ListTester.java (provided). Review the results to make sure that your modified class is working correctly. Your output must include your name. 2. Notes Start with the partially implemented code found with this assignment: SinglyLinked List.java. The class Node is defined as a private inner class of Singly Linked List. Turn in only your modified source files: SinglyLinked List.java and Enhanced List Tester.java. Make sure your class is not in a package (that is, it is in the default package). You will not need to modify Enhanced List Tester.java, except to add your name. 3. Required Main Class Enhanced List Tester, provided 4. Required Input Not pplicable 5. Required Output No example is given. Review your results based on your understanding of List operations to ensure that your modified class is working correctly. 0:[] 1: [Alpha] 2: [Alpha, Tester Dava Application) C\Program FilesVavalidk-18.0 Beta] 3: [Gamma, Alpha, Beta] 4: [Gamma, Alpha, Beta, Delta] First is Gamma Last is Delta Rotated 4: [Alpha, Beta, Delta, Gamma] Rotated 4: [Beta, Delta, Gamma, Alpha] Rotated 4: [Delta, Gamma, Alpha, Beta] Rotated 4: [Gamma, Alpha, Beta, Delta] Removing Gamma Removing Alpha Removing Beta Removing Delta 0:[]

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete the implementation of the SinglyLinkedList class we need to add the following methods removeLast Remove the last element from the list and ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!