The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write the codes for the following methods from the attached file
a. AnyType get
b. AnyType set
c. add
d. Node
e. AnyType removeÂ
Â
Â
Â
Â
import java.util.Iterator;import java.util.ConcurrentModificationException;import java.util.NoSuchElementException;public class DoublyLinkedList<AnyType> implements List<AnyType>{private static class Node<AnyType>{private AnyType data;private Node<AnyType> prev;private Node<AnyType> next;public Node(AnyType d, Node<AnyType> p, Node<AnyType> n){setData(d);setPrev(p);setNext(n);}public AnyType getData() { return data; }public void setData(AnyType d) { data = d; }public Node<AnyType> getPrev() { return prev; }public void setPrev(Node<AnyType> p) { prev = p; }public Node<AnyType> getNext() { return next; }public void setNext(Node<AnyType> n) { next = n; }}private int theSize;private int modCount;private Node<AnyType> header;private Node<AnyType> trailer;public DoublyLinkedList(){header = new Node<AnyType>(null, null, null);trailer = new Node<AnyType>(null, null, null);modCount = 0;clear();}public void clear(){header.setNext(trailer);trailer.setPrev(header);theSize = 0;}public int size(){return theSize;}public boolean isEmpty(){return (size() == 0);}public AnyType get(int index