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.

void<br />

L.split(list item it, list& L1 , list& L2 , int dir)<br />

splits L at item it into lists L1 and L2. Item it<br />

becomes the first item of L2 if dir == leda ::before<br />

and the last item of L1 if dir = leda :: behind.<br />

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

void<br />

L.extract(list item it1 , list item it2 , list& L1 , bool inclusive = true)<br />

extracts a sublist L1 from L. More precisely, if<br />

L = x 1 , . . . , x p , it1 , . . . , it2 , x s , . . . , x n then L1 =<br />

it1 , . . . , it2 and L = x 1 , . . . , x p , x s , . . . , x n . (If<br />

inclusive is false then it1 and it2 remain in L.)<br />

Precondition: it1 and it2 are items of L or nil.<br />

void<br />

L.apply(void (∗f)(E& x)) for all items 〈x〉 in L function f is called with argument<br />

x (passed by reference).<br />

void L.reverse items( ) reverses the sequence of items of L.<br />

void L.reverse items(list item it1 , list item it2 )<br />

reverses the sub-sequence it1, . . . , it2 of items of L.<br />

Precondition: it1 = it2 or it1 appears before it2 in<br />

L.<br />

void L.reverse( ) reverses the sequence of entries of L.<br />

void L.reverse(list item it1 , list item it2 )<br />

reverses the sequence of entries L[it1] . . . L[it2].<br />

Precondition: it1 = it2 or it1 appears before it2 in<br />

L.<br />

void L.permute( ) randomly permutes the items of L.<br />

void L.permute(list item ∗ I) permutes the items of L into the same order as<br />

stored in the array I.<br />

void L.clear( ) makes L the empty list.

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

Saved successfully!

Ooh no, something went wrong!