23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The performance of an adaptable priority queue implemented by means of various<br />

data structures with location-aware entries is summarized <strong>in</strong> Table 8.4.<br />

Table 8.4: Runn<strong>in</strong>g times of the methods of an<br />

adaptable priority queue of size n, realized by means of<br />

an unsorted list, sorted list, <strong>and</strong> heap, respectively. The<br />

space requirement is O(n).<br />

Method<br />

Unsorted List<br />

Sorted List<br />

Heap<br />

size, isEmpty<br />

O(1)<br />

O(1)<br />

O(1)<br />

<strong>in</strong>sert<br />

O(1)<br />

O(n)<br />

O(logn)<br />

m<strong>in</strong><br />

O(n)<br />

O(1)<br />

O(1)<br />

removeM<strong>in</strong><br />

O(n)<br />

O(1)<br />

O(logn)<br />

499

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

Saved successfully!

Ooh no, something went wrong!