Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 19, Problem 4P

(a)

Program Plan Intro

Give theimplementation of the MINIMUM operation on the heap and describe the cost of implementation.

(b)

Program Plan Intro

Write the implementation steps of operation DECREASE-KEY.

(c)

Program Plan Intro

Write the implementation steps of INSERT operation.

(d)

Program Plan Intro

Write the steps of DELETE operation to delete a given leaf nodex without changing the cost of implementation.

(e)

Program Plan Intro

Implement the EXTRACT-MIN operation to extracts the leaf with the smallest key.

(f)

Program Plan Intro

Write the implementation steps of UNION operation without changing the original time taken for implementation.

Blurred answer
Students have asked these similar questions
1-Given the binary min-heap A = [1, 60, 18, 83, 97, 68, 47, 99] do the following: (a)  Draw the tree representation.  (b)  Show the steps involved when inserting the element 8.  (c)  Show the steps involved when deleting the smallest element from A (note that we are deleting from the original heap A, not from the outcome of question 1b).  (d)Given the array [5, 93, 68, 91, 37, 11, 8, 54, 84, 19, 10, 80, 68], create a binary min-heap using the procedure MakeHeap from the lectures. Give a sequence of arrays highlighting the two elements that get swapped in the array and draw a tree representation of the final heap.  (e)Describe (with some pseudocode) how to write an ADT that imple- ments a priority queue using a binary min-heap , and which ALSO allows changing the priority of a key.
8. Given a sequence of numbers: 19, 6, 8, 11, 4, 5(I) Draw a binary min-heap (in a tree form) by inserting the above numbers readingthem from left to right.  (II) Show a tree that can be the result after the call to deleteMin() on the above heap.(III) Show a tree after another call to deleteMin().
.1. Draw the binary min-heap tree that results from inserting   65, 12, 73, 36, 30, 55, 24, 92      in that order into an initially empty binary min heap.       BOX IN YOUR FINAL BINARY MIN HEAP.   .2. Using the final binary min-heap above, show the result of performing a dequeue( ) operation, assuming a priority queue is implemented using a binary min-heap.       BOX IN YOUR FINAL BINARY MIN HEAP.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education