Question

(a) (8 points) Given a set S of records with keys {17, 12, 7,5,6,8, 13, 1, 21, 10, 15, 19}, construct a min pairing heap for(b) (7 points) For the min pairing heap in (a), (i.e., the one that resulted from your construction), perform deleteMin once.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a):

@ Insert S={17, 12, 7,5, 6, 8, 13, 1, 21, 10, 15, 17) I into min heap. Tot Min Heap property: The value at a node must be 1 s

- Insert 5 Min hear property is violated at 17, 5 Again nunheap property is nolated at 37, So swap 7.5. 5 Insert 6 Min hap pr

© Insert: 8 Min heap property is volated at 12, so op 12,8 Insert 13 Min heap property is e satisfied at every node. ② Insert

at 6 Again min heap property is viol ty is violated so swap 6, 1. at 5, Again minheap property is violated so swap 5,1 (13) @

10 Insert: 10 Min heap property is satisfied at all nodes. 1 Insert: 15 Minheap property is satisfied at all nodes. @ Insert:

tinal required munheap is: 01-

(b):

@ Algorithm to delete Min(); posting at the ① Swap 1st & last model & remove last node check for minheap property from root,

② Check for min heap property rows of writing Min heap property, is violated at node 19, so swap 19,5. Min heap property viol

at 19, so Mon heap property is violated Swap 19,17 tinal resultant minheap :

// Mention in comments if any mistakes or errors are found. Thank you.


answered by: ANURANJAN SARSAM
Add a comment
Answer #2

(a):

@ Insert S={17, 12, 7,5, 6, 8, 13, 1, 21, 10, 15, 17) I into min heap. Tot Min Heap property: The value at a node must be 1 s

- Insert 5 Min hear property is violated at 17, 5 Again nunheap property is nolated at 37, So swap 7.5. 5 Insert 6 Min hap pr

© Insert: 8 Min heap property is volated at 12, so op 12,8 Insert 13 Min heap property is e satisfied at every node. ② Insert

at 6 Again min heap property is viol ty is violated so swap 6, 1. at 5, Again minheap property is violated so swap 5,1 (13) @

10 Insert: 10 Min heap property is satisfied at all nodes. 1 Insert: 15 Minheap property is satisfied at all nodes. @ Insert:

tinal required munheap is: 01-

(b):

@ Algorithm to delete Min(); posting at the ① Swap 1st & last model & remove last node check for minheap property from root,

② Check for min heap property rows of writing Min heap property, is violated at node 19, so swap 19,5. Min heap property viol

at 19, so Mon heap property is violated Swap 19,17 tinal resultant minheap :

// Mention in comments if any mistakes or errors are found. Thank you.

Add a comment
Know the answer?
Add Answer to:
(a) (8 points) Given a set S of records with keys {17, 12, 7,5,6,8, 13, 1,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given a set of 10 records with priorities S = {10, 15, 3, 8, 20, 5,...

    Given a set of 10 records with priorities S = {10, 15, 3, 8, 20, 5, 17, 27, 19, 22}. Construct a 2-3 tree T for S by inserting the records, in the given order, into an initially empty 2-3 tree. When done, delete 10, and then 17 from the tree. Construct a 2-3 tree T for S by inserting the records, in the reverse given order, into an initially empty 2-3 tree. When done, delete 10, and then 17...

  • I've posted 3 classes after the instruction that were given at start You will implement and...

    I've posted 3 classes after the instruction that were given at start You will implement and test a PriorityQueue class, where the items of the priority queue are stored on a linked list. The material from Ch1 ~ 8 of the textbook can help you tremendously. You can get a lot of good information about implementing this assignment from chapter 8. There are couple notes about this assignment. 1. Using structure Node with a pointer point to Node structure to...

  • 1 L, as a dynamical system (Notes from Assignment #2) We take our definition of dynamical system ...

    1 L, as a dynamical system (Notes from Assignment #2) We take our definition of dynamical system to be an "object" along with a specific set of modifications that can be performed (dynamically) upon this object. In this case, the object is a bi-infinite straight road with a lamp post at every street corner and a marked lamp (the position of the lamplighter). There are two possible types of modifications: the lamplighter can walk any distance in either direction from...

  • In this project, you will construct an Object-Oriented framework for a library system. The library must...

    In this project, you will construct an Object-Oriented framework for a library system. The library must have books, and it must have patrons. The patrons can check books out and check them back in. Patrons can have at most 3 books checked out at any given time, and can only check out at most one copy of a given book. Books are due to be checked back in by the fourth day after checking them out. For every 5 days...

  • Can't figure out the concentration of the complex of solns. 10, 11, 12, 13, & 14. Modern...

    Can't figure out the concentration of the complex of solns. 10, 11, 12, 13, & 14. Modern Experimental Chemistry Chemistry 153 The Iron(III) Thiocyanate Complex Purpose of the Experiment To determine the chemical formula of a complex ion and measure its formation equilibrium constant Equipment Spectro Vis spectrophotometer and LabQuest, cuvette, 25-mL buret (3), ring stand, buret clamp (2), 50-mL beaker (3), small plastic beakers Reagents SCN, as KSCN, 0.00200 M solution Fe; as Fe(NO), 0.00200 M solution and a...

  • **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the...

    **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the creatures from the classic science-fiction film "The Day of the Triffids") is an algorithm that enciphers a plaintext message by encoding each letter as a three-digit number and then breaking up and rearranging the digits from each letter's encoded form. For this assignment, you will create a set of Python functions that can encode messages using this cipher (these functions...

  • Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C -...

    Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT