Bidirectional linked list.
| Element | *first | Pointer to the first element of the list, or NULL. |
| Element | *last | Pointer to the last element of the list, or NULL. |
| unsigned long |
Returns the number of elements currently in the list. | |||
| void |
Appends an element to the list. | |||
| void |
Appends an element to the specified element of list, initializing
the element's data field with a specified value. | |||
| void |
Prepends an element to the specified element of the list, initializing
the element's data field with a specified value. | |||
| void |
Removes an element from the list. | |||
| void |
Clears the list, i.e. removes all elements from it. |
Returns the number of elements currently in the list.
unsigned long getNumElements ()
Appends an element to the list.
After the completion of this method a new element will be inserted right after the specified element.
A default constructor must exist for type T.
void appendEmpty (Element *element)
| element : | The element after which the new element is to be inserted. |
Appends an element to the specified element of list, initializing the element's data field with a specified value.
The element's value will be set using the copy constructor for type T.
void append (const T &data, Element *element)
| data : | The value to be assigned to the data field of the newly created element. |
| element : | The element after which the new element is to be inserted. |
Prepends an element to the specified element of the list, initializing the element's data field with a specified value.
The element's value will be set using the copy constructor for type T.
void prepend (T &data, Element *element)
| data : | The value to be assigned to the data field of the newly created element. |
| element : | The element before which the new element is to be inserted. |
Removes an element from the list.
void remove (Element *element)
| element : | The element to be removed from the list. |
Clears the list, i.e. removes all elements from it.
void clear ()