Your HeapImpl12 class must offer a public constructor that takes exactly one parameter, d, that specifies the maximum number of children that any one node in the heap may have. The heap that your class implements must be a complete d-ary tree. You should use an array as the underlying storage for the tree. Similarly to what was demonstrated during class for binary heaps, you must devise a scheme to "map" any node of the d-ary tree into an array index. As the user adds elements to the heap, it may be necessary to "resize" the array of nodes; you should employ a similar method as was shown during lecture for the ArrayList implementation; this resizing should be hidden from the user completely.
To get started, download this skeleton file.
You are encouraged to employ unit testing to test your heap implementation, but it is not strictly required for this assignment.
Your assignment will be graded using automated testers and also through manual inspection.
To instantiate the array of nodes, you will need to downcast into the type T[] in a similar manner as you did in P2. However, for P3 you cannot just instantiate an Object[] array because the heap requires that the data all be Comparable; hence, instead you should instantiate the underlying array as: T[] nodeArray = (T[]) new Comparable[128]. (The choice of 128 was arbitrary.)