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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Creation<br />

sortseq S;<br />

creates an instance S of type sortseq based on the linear order<br />

defined by the global compare function and and initializes it to the empty<br />

sorted sequence.<br />

sortseq S(int (∗cmp) (const K& , const K& ));<br />

creates an instance S of type sortseq based on the linear order<br />

defined by the compare function cmp and initializes it with the empty<br />

sorted sequence.<br />

4. Operations<br />

const K& S.key(seq item it)<br />

const I& S.inf(seq item it)<br />

returns the key of item it.<br />

returns the information of item it.<br />

I& S[seq item it] returns a reference to the information of item it.<br />

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

seq item S.lookup(const K& k) returns the item with key k (nil if there is no such<br />

item).<br />

seq item S.finger lookup(const K& k)<br />

seq item S.finger lookup from front(const K& k)<br />

seq item S.finger lookup from rear(const K& k)<br />

equivalent to S.lookup(k)<br />

equivalent to S.lookup(k)<br />

equivalent to S.lookup(k)<br />

seq item S.locate(const K& k) returns the item 〈k1 , i〉 in S such that k1 is minimal<br />

with k1 ≥ k (nil if no such item exists).<br />

seq item S.finger locate(const K& k)<br />

seq item S.finger locate from front(const K& k)<br />

seq item S.finger locate from rear(const K& k)<br />

equivalent to S.locate(k)<br />

equivalent to S.locate(k)<br />

equivalent to S.locate(k)<br />

seq item S.locate succ(const K& k)<br />

equivalent to S.locate(k)

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

Saved successfully!

Ooh no, something went wrong!