lec24a - Lecture 24 Heap initialization Leftist trees...

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

View Full Document Right Arrow Icon
Lecture 24 Heap initialization Leftist trees 13.4.4, 13.5
Background image of page 1

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] 4 6 7 8 9 3 10 1 11 5 2
Background image of page 2
Initializing A Max Heap Start at rightmost array position that has a child. 4 6 7 8 9 3 10 1 11 5 2 Index is n/2 . Heapify!
Background image of page 3

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap Move to next lower array position. 4 6 7 8 9 3 10 1 5 11 2
Background image of page 4
Initializing A Max Heap 4 6 7 8 9 3 10 1 5 11 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap 9 6 7 8 4 3 10 1 5 11 2
Background image of page 6
Initializing A Max Heap 9 6 7 8 4 3 10 1 5 11 2
Background image of page 7

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap 9 6 3 8 4 7 10 1 5 11 2
Background image of page 8
Initializing A Max Heap 9 6 3 8 4 7 10 1 5 11 2
Background image of page 9

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap 9 6 3 8 4 7 10 1 5 11 Find a home for 2 .
Background image of page 10
Initializing A Max Heap 9 6 3 8 4 7 5 1 11 Find a home for 2 . 10
Background image of page 11

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap 9 6 3 8 4 7 2 1 11 Done, move to next lower array position. 10 5
Background image of page 12
Initializing A Max Heap 9 6 3 8 4 7 2 1 11 10 5 Find home for 1 .
Background image of page 13

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

View Full DocumentRight Arrow Icon
11 Initializing A Max Heap 9 6 3 8 4 7 2 10 5 Find home for 1 .
Background image of page 14
Initializing A Max Heap 9 6 3 8 4 7 2 11 10 5 Find home for 1 .
Background image of page 15

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

View Full DocumentRight Arrow Icon
Initializing A Max Heap 9 6 3 8 4 7 2 11 10 5 Find home for 1 .
Background image of page 16
Initializing A Max Heap 9 6 3 8 4 7 2 11 10 5 Done. 1
Background image of page 17

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

View Full DocumentRight Arrow Icon
Time Complexity 6 3 4 7 10 11 5 2 9 8 1 Height of heap = h . Number of subtrees with root at level j is <= 2 j-1 .
Background image of page 18
Image of page 19
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/18/2012 for the course COP 3530 taught by Professor Davis during the Fall '08 term at University of Florida.

Page1 / 54

lec24a - Lecture 24 Heap initialization Leftist trees...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online