public class DLinkedListImpl implements DLinkedList { private static class Node { E value; Node prev; Node next; Node(E eValue) { value = eValue; prev = null; next = null; } } Node head; Node tail; public DLinkedListImpl() { head = new Node(); tail = new Node(); head.next = tail; tail.prev = head; } public void add(E e) { Node temp = new Node(e); temp.prev = tail.prev; temp.next = tail; (temp.prev).next = temp; tail.prev = temp; return; } public boolean contains(E e) { Node temp = head.next; while(temp != null) { if (temp.value = e) { return true; } } return false; } public printList(void) { Node temp = head.next; while(temp != null) { System.out.println(temp.value + "\n"); } return; } public static void main(String[] args) { DLinkedListImpl a = new DLinkedListImpl(); a.add("A"); a.add("B"); a.add("C"); a.printList(); return; } }