Priority Queues and Heaps_Part_5

# Priority Queues and Heaps_Part_5 - Prof. J. Elder - 23 -...

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 - 21 - We can construct a heap storing n keys using a bottom-up construction with log n phases In phase i , pairs of heaps with 2 i ± 1 keys are merged into heaps with 2 i + 1 ± 1 keys Bottom-up Heap Construction 2 i ± 1 2 i ± 1 2 i + 1 ± 1

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 - 22 - Example 15 16 12 4 7 6 20 23 25 15 16 5 12 4 11 7 6 27 20 23
Last Updated: 06/02/12 8:32 PM CSE 2011

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.

Unformatted text preview: Prof. J. Elder - 23 - Example (contd.) 25 15 16 5 12 4 11 9 6 27 20 23 15 25 16 4 12 5 6 9 11 20 27 23 Last Updated: 06/02/12 8:32 PM CSE 2011 Prof. J. Elder - 24 - Example (contd.) 7 15 25 16 4 12 5 8 6 9 11 20 27 23 4 15 25 16 5 12 7 6 8 9 11 20 27 23 Last Updated: 06/02/12 8:32 PM CSE 2011 Prof. J. Elder - 25 - Example (end) 4 15 25 16 5 12 7 10 6 8 9 11 23 20 27 5 15 25 16 7 12 10 4 6 8 9 11 20 27 23...
View Full 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_5 - Prof. J. Elder - 23 -...

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

View Full Document
Ask a homework question - tutors are online