DOUBLY LINKED LISTS
Standard Operations
5
‣
DoublyLinkedList(): Constructs an empty doubly linked list.
‣
isEmpty():Returns true if the doubly linked list does not contain any item.
‣
size(): Returns the number of items in the doubly linked list.
‣
get(int index): Returns the item at the specified index.
‣
addFirst(Item item): Inserts the specified item at the head of the doubly
linked list.
‣
addLast(Item item): Inserts the specified item at the tail of the doubly linked
list.
‣
add(int index, Item item): Inserts the specified item at the specified index.
‣
Item removeFirst(): Retrieves and removes the head of the doubly linked list.
‣
Item removeLast(): Retrieves and removes the tail of the doubly linked list.
‣
Item remove(int index): Retrieves and removes the item at the specified
index.