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 S.del(const K& k)<br />

removes the item with key k from S (null operation if no such item<br />

exists).<br />

void<br />

S.del item(seq item it)<br />

removes the item it from the sequence containing it.<br />

void S.change inf(seq item it, const I& i)<br />

makes i the information of item it.<br />

void S.split(seq item it, sortseq& S1 , sortseq& S2 ,<br />

int dir = leda :: behind)<br />

splits IT at item it, where IT is the sequence containing it, into sequences<br />

S1 and S2 and makes IT empty (if distinct from S1 and<br />

S2 ). More precisely, if IT = x 1 , . . . , x k−1 , it, x k+1 , . . . , x n and dir =<br />

leda :: behind then S1 = x 1 , . . . , x k−1 , it and S2 = x k+1 , . . . , x n . If<br />

dir = leda :: before then S2 starts with it after the split.<br />

void S.delete subsequence(seq item a, seq item b, sortseq& S1 )<br />

deletes the subsequence starting at a and ending at b from the sequence<br />

IT containing both and assigns the subsequence to S1 .<br />

Precondition: a and b belong to the same sequence IT, a is equal to or<br />

before b and IT and S1 have the same type.<br />

sortseq& S.conc(sortseq& S1 , int dir = leda :: behind)<br />

appends S1 at the front (dir = leda :: before) or rear (dir =<br />

leda :: behind) end of S, makes S1 empty and returns S.<br />

Precondition: S.key(S.max item( )) < S1.key(S1.min item( )) if dir =<br />

leda :: behind and S1.key(S1.max item( )) < S.key(S.min item( ) if<br />

dir = leda :: before.<br />

void S.merge(sortseq& S1 )<br />

merges the sequence S1 into sequence S and makes S1 empty.<br />

Precondition: all keys are distinct.<br />

void S.print(ostream& out, string s, char c = ’ ’)<br />

prints s and all elements of S separated by c onto stream out.<br />

void S.print(string s, char c = ’ ’)<br />

equivalent to S.print(cout, s, c).<br />

bool<br />

S == const sortseq& S1<br />

returns true if S agrees with S1 componentwise and false otherwise<br />

sortseq∗ sortseq:: my sortseq(seq item it)<br />

returns a pointer to the sortseq containing it.<br />

Precondition: <strong>The</strong> type of the sortseq containing it must be<br />

sortseq.

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

Saved successfully!

Ooh no, something went wrong!