Class List
Placement in the overall structure
- Module
- object
- Base classes
- Queue
- Derived classes
- Bellringer
- Time of creation
- Template for Task 6
- Files
list.h list.cc
Description
The List class implements a singly linked list of (meaningfully specialized)
Chain objects. In contrast to Queue
,
however, elements can also be inserted at the beginning or in the middle.
Public methods
List ()
- The constructor initializes the list as empty.
Chain* first ()
- Returns the first element of the list without removing it.
void insert_first (Chain* new_item)
- Inserts the
new_item
element at the beginning of the list. void insert_after (Chain* old_item, Chain* new_item)
- Inserts the
new_item
element after theold_item
element in the list.