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 upward movement of the newly <strong>in</strong>serted entry by means of swaps is<br />

conventionally called up-heap bubbl<strong>in</strong>g. A swap either resolves the violation of<br />

the heap-order property or propagates it one level up <strong>in</strong> the heap. In the worst<br />

case, up-heap bubbl<strong>in</strong>g causes the new entry to move all the way up to the root of<br />

heap T. (See Figure 8.7.) Thus, <strong>in</strong> the worst case, the number of swaps performed<br />

<strong>in</strong> the execution of method <strong>in</strong>sert is equal to the height of T, that is, it is<br />

logn by Proposition 8.5.<br />

Removal<br />

481

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

Saved successfully!

Ooh no, something went wrong!