list has a large
interface with many methods. In this introduction we could
describe only the most important ones.
max() return an item that refers to
the minimum and maximum, respectively, of the values stored in a
list (regarding the default order
compare()). The method
print() has a sister method
read(), which can be parameterized in
many different ways. The bounds of the interval [l..r] can
be passed to the method
if they are already known, and similar more.
The corresponding manual page gives more detailed information about all these methods and possibilities.
list is implemented by
doubly linked linear lists.
list contains n elements of
T and c is the time it takes to compare two
objects of type
T, the following asymptotic
running times hold:
print(); here, k is the time it takes
to copy an object of type
here, d is the time it takes to destroy an object of type
here, e is the time it takes to apply function
f (which computes the
bucket numbers) to an object of type
O(1): all other operations.
listis the structure of choice if objects must be stored in a linear sequence and if a new object must frequently be inserted or deleted in front of or behind a certain object.
slistis more storage efficient than a
setmay rather be the structure of choice. This primarily holds when no good “starting point” is known for the search.
arraycan be more useful.