Question: Hello please include java screenshots of the code along with the out put much appreciated :) Implement a doubly linked list - the MyLinkedList class

Hello please include java screenshots of the code along with the out put much appreciated :)

Implement a doubly linked list - the MyLinkedList class in Chapter 24 is a one-way directional singly linked list that enables on-way traversal of the list. Modify the Node class to add the new data field name previous to refer to the previous node in the list, as follows:

public class Node { E element; Node next; Node previous; public Node(E e) { element = e; } }

Implement the following methods in MyDoublyLinkedList.

  1. public MyLinkedList()
  2. public MyLinkedList(E[] objects)
  3. public E getFirst()
  4. public E getLast()
  5. public void addFirst(E e)
  6. public void addLast(E e)
  7. public void add(int index, E e)
  8. public E removeFirst()
  9. public E removeLast()
  10. public E remove(int index)
  11. public String toString()
  12. public void clear()
  13. public boolean contains(Object e)
  14. public E get(int index)
  15. public int indexOf(Object e)
  16. public int lastIndexOf(E e)
  17. public E set(int index, E e)
  18. public int size()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!