Question

Consider the min-priority queue implemented by a binary heap. (The max-priority queue is treated in §6.5...

  1. Consider the min-priority queue implemented by a binary heap. (The max-priority queue is treated in §6.5 Priority queues in the textbook.)
    1. Show the binary tree implemented by the array A = 〈5, 8, 9, 11, 10, 12, 10, 12, 15, 11, 14, 13, 16, 15〉.
    2. Show the binary tree resulting from Heap-Insert(A, 6) where A is the array in (a).
    3. Show the binary tree resulting from Extract-Min(A) where A is the array in (a).
    4. Show the binary tree resulting from Heap-Decrease-Key(A, 10, 6) where A is the array in (a).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

Step 1: Insert keys 5 & 8      

  

Step 2: Insert key 9                     

      

Step 3: Insert key 11

Step 4: Insert key 10                    

                                   

Step 5: Insert key 12    

                     

Step 6: Insert key 10                         

                                                        

Step 7: Insert keys 12                

Step 8: Insert key 15              

            

Step 9: Insert key 11

Step 10: Insert key 14        

        

Step 11: Insert key 13                 

         

Step 12: Insert key 16

Step 13: Insert key 15               

Which is Required Binary Serach Tree(BST)

b) Insert 6:

c) Extract Min:

Add a comment
Know the answer?
Add Answer to:
Consider the min-priority queue implemented by a binary heap. (The max-priority queue is treated in §6.5...
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
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