Question: Rather than crea 9 ng binary heaps, we can create a d - ary heap, where each node has d children, rather than 2 .
Rather than creang binary heaps, we can create a dary heap, where each
node has d children, rather than
a How would you represent a dary heap in an array? Be precise, specifically give
pseudocode for parent and children funcons.
b Write pseudocode for the Heapify funcon for the dary heap. You may make
any reasonable assumpon about referencing the children as long as it is clear.
c What is the running me of Heapify in terms of n and d
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
