A doubly-linked list is a data structure for storing and manipulating a sequence of elements.
List
List_Set
The doubly-linked list implementation in Pastel has the following properties:
Task / Property | Complexity |
---|---|
Insert / remove an element, before a given element. | |
Move an element, before a given element in a given list. | |
Move all elements, from a list to another. | |
Move a range of elements, inside a list. | |
Move a range of elements, from a list to another. | |
Find out the number of elements in a list. | |
Find out whether an iterator is null / begin / end / normal. |
Each node stores the list structure. Each normal node additionally stores a user-data. Each end-node additionally stores an end-data, and a user-data if the user so specifies. Both the user-data and the end-data can be specified as void
, to avoid allocating memory for them.
std::list
The list implementation in Pastel can be thought of an enhanced std::list
:
The doubly-linked list is subject to the iterator debugging problem, and so the user-data or the end-data cannot be inspected directly through the debugger.