Part 9 Symmetric Mix-Max Heaps

Post on 04-Jan-2016

37 views 0 download

Tags:

description

Part 9 Symmetric Mix-Max Heaps. Return with min priority Return with max priority Insert arbitrary priority Delete min priority Delete max priority. Exercises. Page 469, Problem 2 Page 469, Problem 3 Page 469, Problem 4. SMMH. A complete binary tree Empty root - PowerPoint PPT Presentation

Transcript of Part 9 Symmetric Mix-Max Heaps

Part 9Symmetric Mix-Max Heaps

• Return with min priority

• Return with max priority

• Insert arbitrary priority

• Delete min priority

• Delete max priority

Exercises

• Page 469, Problem 2

• Page 469, Problem 3

• Page 469, Problem 4

SMMH

• A complete binary tree

• Empty root

• Min is the left child of root

• Max is the right child of root

• Left right sibling≦• LeftChild(grandparent) node≦• RightChild(grandparent) node≧

SMMH

• Page 530, fig 9.25

Insertion

• Page 533, fig 9.26

Insertion

• Page 533, fig 9.27

Insertion

• Page 534. fig 9.28

Insertion

• Page 534, fig 9.29

Insertion

• Page 535, fig 9.30

Insertion

• Page 535, fig 9.31

Deletion

• Page 538, fig 9.32

Deletion

• Page 538, fig 9.33

Deletion

• Page 539, fig 9.34

Deletion

• Page 539, fig 9.35

Deletion

• Page 540, fig 9.36

Deletion

• Page 540, fig 9.37

Deletion

• Page 541, fig 9.38