Question: Exercise 3 . The ( k ) - ary heap. [ 2 0 points ] A ( k ) - ary
Exercise The k ary heap.
points
A k ary heap is a generalization of the binary heaps we studied in class: it is a complete k ary tree with the heap property, which means that for any node in the heap, its parent is of higher priority. When k we have a familiar binary heap.
Though programmed almost identically to the binary heap no matter our choice of k geq the time complexities in a k ary heap depend on k ; deletemin takes roughly k log k n operations, and insert takes roughly log k n operations.
In particular, we can implement buildmaxkheap, an algorithm that takes in a list of n distinct integers and an integer leq k
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
