LinkedList doubly linked list


Inherits from: Object : Collection : SequenceableCollection 


LinkedList implements a doubly linked list.


Instance Methods


Most methods are inherited from the superclasses.


addFirst(obj)


Add an item to the head of the list.


add(obj)


Add an item to the tail of the list.


remove(obj)


Remove an item from the list.


pop


Remove and return the last item in the list.


popFirst


Remove and return the first item in the list.


first


Return the first item in the list.


last


Return the last item in the list.


at(index)


Return the item at the given index in the list. 

This requires a scan of the list and so is O(n).


put(index, obj)


Put the item at the given index in the list. 

This requires a scan of the list and so is O(n).


removeAt(index)


Remove and return the item at the given index in the list.

This requires a scan of the list and so is O(n).