Lab 7

Due Friday 5/1 - 5PM

Implement a Linked List that supports the following methods:
  • insertAtHead(Obejct o) - inserts the new element o at the head of the list.
  • insertAtTail(Object o) - inserts the new element o at the tail of the list.
  • removeHead() - removes the first node of the list.  Throws a ListEmptyException if the list has no elements.
  • removeTail() - removes the last node of the list.  Throws a ListEmptyException if the list has no elements.
  • printAll() - print out all elements in the list.
  • printAllReverse() - print out all elements in the list in reverse order.
Comments