Practice: DoubleLinkedList

Take out a piece of paper. We’ll be programming on paper.

Problem 1

public class DLinkedList<E> implements List211<E> {
  /** Holds the head of the list. */
  private DLinkedNode head;
  /** The size of the list. */
  private int size;

  /**
   * Inserts the specified element at the specified position in this list. Shifts the element currently at that
   * position (if any) and any subsequent elements to the right (adds one to their indices).
   * @param index index at which the specified element is to be inserted
   * @param element element to be inserted
   * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index > size())
   */


  /** Doubly linked node. */
  private class DLinkedNode {
    E data;
    DLinkedNode next;
    DLinkedNode prev;
  }
}

Problem 2

Show me your code before you leave