Question: A d-ary heap is like a binary heap except that non-leaf nodes have d children instead of 2 children (with one possible exception for
A d-ary heap is like a binary heap except that non-leaf nodes have d children instead of 2 children (with one possible exception for the last leaf). Also see CLRS Problem 6.1, page 167. In this question, we consider 3-ary max-heaps. a. Given an array A and index i, how do you compute the left child, the right child, and the parent of A[i]. b. C. d. e. What is the height of a 3-ary heap of n elements? Justify your answer briefly. Write a version of Max-Heapify for a 3-ary max-heap and analyze its running time. Write a version of Build-Heap for a 3-ary max-heap and analyze its running time. [2, 8, 5, 4, 7, 10, 12, 6]. Invoke your Build-Heap(A) to build a 3-ary max-heap. Just Let array A = show the resulting array.
Step by Step Solution
There are 3 Steps involved in it
a To compute the left child right child and parent of Ai in a 3ary heap Left child 3 i 1 Middle chil... View full answer
Get step-by-step solutions from verified subject matter experts
