Part 9 Symmetric Mix-Max Heaps
description
Transcript of Part 9 Symmetric Mix-Max Heaps
![Page 1: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/1.jpg)
Part 9Symmetric Mix-Max Heaps
• Return with min priority
• Return with max priority
• Insert arbitrary priority
• Delete min priority
• Delete max priority
![Page 2: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/2.jpg)
Exercises
• Page 469, Problem 2
• Page 469, Problem 3
• Page 469, Problem 4
![Page 3: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/3.jpg)
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≧
![Page 4: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/4.jpg)
SMMH
• Page 530, fig 9.25
![Page 5: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/5.jpg)
Insertion
• Page 533, fig 9.26
![Page 6: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/6.jpg)
Insertion
• Page 533, fig 9.27
![Page 7: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/7.jpg)
Insertion
• Page 534. fig 9.28
![Page 8: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/8.jpg)
Insertion
• Page 534, fig 9.29
![Page 9: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/9.jpg)
Insertion
• Page 535, fig 9.30
![Page 10: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/10.jpg)
Insertion
• Page 535, fig 9.31
![Page 11: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/11.jpg)
Deletion
• Page 538, fig 9.32
![Page 12: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/12.jpg)
Deletion
• Page 538, fig 9.33
![Page 13: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/13.jpg)
Deletion
• Page 539, fig 9.34
![Page 14: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/14.jpg)
Deletion
• Page 539, fig 9.35
![Page 15: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/15.jpg)
Deletion
• Page 540, fig 9.36
![Page 16: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/16.jpg)
Deletion
• Page 540, fig 9.37
![Page 17: Part 9 Symmetric Mix-Max Heaps](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813985550346895da11993/html5/thumbnails/17.jpg)
Deletion
• Page 541, fig 9.38