31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

const E& L.head( )<br />

const E& L.tail( )<br />

returns the first element of L, i.e. the contents of<br />

L.first().<br />

Precondition: L is not empty.<br />

returns the last element of L, i.e. the contents of<br />

L.last().<br />

Precondition: L is not empty.<br />

slist item L.push(const E& x) adds a new item 〈x〉 at the front of L and returns<br />

it.<br />

slist item L.append(const E& x) appends a new item 〈x〉 to L and returns it.<br />

slist item<br />

L.insert(const E& x, slist item pos)<br />

inserts a new item 〈x〉 after item pos into L and<br />

returns it.<br />

Precondition: it is an item in L.<br />

const E& L.pop( )<br />

deletes the first item from L and returns its contents.<br />

Precondition: L is not empty.<br />

void<br />

L.del succ item(slist item it)<br />

deletes the successor of item it from L.<br />

Precondition: it is an item in L and has a successor.<br />

void L.conc(slist& L1 ) appends list L 1 to list L and makes L 1 the empty<br />

list.<br />

Precondition: L ! = L 1 .<br />

E& L[slist item it] returns a reference to the contents of it.<br />

slist item L += const E& x appends a new item 〈x〉 to L and returns it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!