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.

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

bool Q.empty( ) returns true if Q is empty, false otherwise.<br />

int Q.lower bound( ) returns the lower bound of the priority interval<br />

[a..b].<br />

int Q.upper bound( ) returns the upper bound of the priority intervall<br />

[a..b].<br />

4. Implementation<br />

Bounded priority queues are implemented by arrays of linear lists. Operations insert,<br />

find min, del item, decrease key, key, inf, and empty take time O(1), del min (= del item<br />

for the minimal element) takes time O(d), where d is the distance of the minimal element<br />

to the next bigger element in the queue (= O(b − a) in the worst case). clear takes time<br />

O(b − a + n) and the space requirement is O(b − a + n), where n is the current size of the<br />

queue.

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

Saved successfully!

Ooh no, something went wrong!