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.

list S.intersection sorted(const rat segment& q)<br />

list S.intersection(const rat line& l)<br />

list S.intersection sorted(const rat line& l)<br />

void S.del(const rat segment& s)<br />

as above, but the returned segments are ordered<br />

as they are intersected by q if one travels from<br />

q.source( ) to q.target( ).<br />

returns all items ∈ S with s ∩ l ≠ ∅.<br />

Precondition: l is orthogonal to the segments in<br />

S.<br />

as above, but the returned segments are ordered<br />

as they are intersected by l if one travels along<br />

l in direction l.direction( ).<br />

deletes the item with segment s from S.<br />

void S.del item(seg item it) removes item it from S.<br />

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

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

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

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

void S.clear( ) makes S the empty rat segment set.<br />

bool S.empty( ) returns true iff S is empty.<br />

int S.size( ) returns the size of S.<br />

4. Implementation<br />

Segment sets are implemented by dynamic segment trees based on BB[α] trees ([90, 57])<br />

trees. Operations key, inf, change inf, empty, and size take time O(1), insert, lookup, del,<br />

and del item take time O(log 2 n) and an intersection operation takes time O(k + log 2 n),<br />

where k is the size of the returned list. Here n is the current size of the set. <strong>The</strong> space<br />

requirement is O(n log n).

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

Saved successfully!

Ooh no, something went wrong!