Priority Queues and Heaps_Part_6

# Priority Queues and Heaps_Part_6 - Analysis We visualize...

This preview shows pages 1–5. Sign up to view the full content.

Last Updated: 06/02/12 8:32 PM CSE 2011 Prof. J. Elder - 26 - Analysis We visualize the worst-case time of a downheap with a proxy path that goes first right and then repeatedly goes left until the bottom of the heap (this path may differ from the actual downheap path) Since each node is traversed by at most two proxy paths, the total number of nodes of the proxy paths is O ( n ) Thus, bottom-up heap construction runs in O ( n ) time Bottom-up heap construction is faster than n successive insertions (running time ?).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Last Updated: 06/02/12 8:32 PM CSE 2011 Prof. J. Elder - 27 - Bottom-Up Heap Construction Uses downHeap to reorganize the tree from bottom to top to make it a heap. Can be written concisely in either recursive or iterative form.
Last Updated: 06/02/12 8:32 PM

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

### Page1 / 5

Priority Queues and Heaps_Part_6 - Analysis We visualize...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online