int |
L.length() |
returns the length of L.
|
int |
L.size() |
returns L.length().
|
bool |
L.empty() |
returns true if L is empty, false otherwise.
|
slist_item |
L.first() |
returns the first item of L.
|
slist_item |
L.last() |
returns the last item of L.
|
slist_item |
L.succ(slist_item it) |
returns the successor item of item it, nil if
it = L.last().
Precondition it is an item in L.
|
slist_item |
L.cyclic_succ(slist_item it) |
|
|
returns the cyclic successor of item it, i.e.,
L.first() if it = L.last(), L.succ(it) otherwise.
|
const E& |
L.contents(slist_item it) |
returns the contents L[it] of item it.
Precondition it is an item in L.
|
const E& |
L.inf(slist_item it) |
returns L.contents(it).
Precondition it is an item in L.
|
const E& |
L.head() |
returns the first element of L, i.e. the contents
of L.first().
Precondition L is not empty.
|
const E& |
L.tail() |
returns the last element of L, i.e. the contents
of L.last().
Precondition L is not empty.
|
slist_item |
L.push(const E& x) |
adds a new item < x > at the front of L and returns it.
|
slist_item |
L.append(const E& x) |
appends a new item < x > to L and returns it.
|
slist_item |
L.insert(const E& x, slist_item pos) |
|
|
inserts a new item < x > after item pos into L and
returns it.
Precondition it is an item in L.
|
const E& |
L.pop() |
deletes the first item from L and returns its
contents.
Precondition L is not empty.
|
void |
L.del_succ_item(slist_item it) |
|
|
deletes the successor of item it from L.
Precondition it is an item in L and has a successor.
|
void |
L.conc(slist<E>& L1) |
appends list L1 to list L and makes L1 the empty list.
Precondition
L ! = L1.
|
E& |
L[slist_item it] |
returns a reference to the contents of it.
|
slist_item |
L += const E& x |
appends a new item < x > to L and returns it.
|