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.

4. Implementation<br />

Sets are implemented by randomized search trees [2]. Operations insert, del, member<br />

take time O(log n), empty, size take time O(1), and clear takes time O(n), where n is the<br />

current size of the set.<br />

<strong>The</strong> operations join, intersect, and diff have the following running times: Let S 1 and S 2<br />

be a two sets of type T with | S 1 |= n 1 and | S 2 |= n 2 . <strong>The</strong>n S 1 .join(S 2 ) and S 1 .diff(S 2 )<br />

need time O(n 2 log(n 1 + n 2 )), S 1 .intersect(S 2 ) needs time O(n 1 log(n 1 + n 2 ).

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

Saved successfully!

Ooh no, something went wrong!