public class DoublyLinkedList { private static class Node { F val; Node prev, next; public Node(F v, Node p, Node n) { val = v; p = prev; next = n; } } Node first, last; int size; public DoublyLinkedList() { first = null; last = null; size = 0; } /** * Returns the number of items in the list. * @return the number of items in the list. */ public int size(){ return size; } /** * Returns the first item in the list. * * @return the first item in the list. */ public E getFirst() { // TODO return null; } /** * Returns the last item in the list. * * @return the last item in the list. */ public E getLast() { // TODO return null; } /** * Adds the given item to the start of the list. * * @param item the item to be added. */ public void addFirst(E item) { // TODO } /** * Adds the given item to the end of the list. * * @param item the item to be added. */ public void addLast(E item) { // TODO } /** * Returns and removes the first item in the list. * * @return the first item in the list. */ public E removeFirst() { // TODO return null; } /** * Returns and removes the last item in the list. * * @return the last item in the list. */ public E removeLast() { // TODO return null; } }