1) What is a good worst - case upper bound in terms of k and n on the time to delete the minimum element from the heap, and restore the heap? 2) Describe IN ENGLISH an algorithm to print out all...

1 answer below »
case upper bound in terms of k and n on the time to delete the minimum element from the heap, and restore the heap?2) Describe IN ENGLISH an algorithm to print out all elements of the heap wich are less than a given value N. If there are m such elements, what is the complexity of your algorithm?3) Illustrate the operation of stable Counting - Sort on the array A = { 4, 5, 2, 0, 5, 3, 4, 6, 4, 3, 2} Thanks


1) What is a good worst - case upper bound in terms of k and n on the time to delete the minimum element from the heap, and restore the heap? 2) Describe IN ENGLISH an algorithm to print out all elements  of the heap wich are less than a given value N. If there are m such elements, what is the complexity of your algorithm? 3) Illustrate the operation of stable Counting - Sort on the array A = { 4, 5, 2, 0, 5, 3, 4, 6, 4, 3, 2}  Thanks 1) Consider k – ary heaps of n elements where each k-node has k children : a) What is a good worst - case upper bound in terms of k and n on the time to delete the minimum element from the heap, and restore the heap? b) Describe IN ENGLISH an algorithm to print out all elements  of the heap which are less than a given value N. If there are m such elements, what is the complexity of your algorithm? 2) Illustrate the operation of stable Counting - Sort on the array A = { 4, 5, 2, 0, 5, 3, 4, 6, 4, 3, 2}  Thanks
Answered Same DayApr 22, 2021

Answer To: 1) What is a good worst - case upper bound in terms of k and n on the time to delete the minimum...

Sandeep Kumar answered on Apr 22 2021
151 Votes
A k-ary heap is in no way different than the binary heap except in the fact that here each node can have at max k children, unlike binary heap which at max can only have 2 child nodes. In all other senses, it is similar to a binary heap like how nodes are inserted, how nodes are deleted, min and max heap properties, and so on. 
a) The values are represented in an array in the same way as we would for a binary heap. 
See the tree will look something like this:- 
So we can see that the root will be at index 0. Then next k indexes will be used for children of the root node. We can see that the root node is at index 0 and its children are at nodes 1, 2, ..., k...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here