Priority Queues and Heaps_Part_6

Priority Queues and Heaps_Part_6 - Analysis We visualize...

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

View Full Document Right Arrow Icon
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 ?).
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
Last Updated: 06/02/12 8:32 PM
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
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 Right Arrow Icon
Ask a homework question - tutors are online