Question: JAVA MaxHeap.java: Defines a max-heap using an array. Unlike the pseudo-code in the textbook, our heap expands automatically by doubling the array when it becomes
JAVA
MaxHeap.java: Defines a max-heap using an array. Unlike the pseudo-code in the textbook, our heap expands automatically by doubling the array when it becomes full. Each node within the max-heap contains one of the six types of tasks. The pseudo-code in the textbook will have to be adapted to work with an array of Task objects containing keys instead of simply keys. The MaxHeap should have at least the following operations: heapify, max, extractMax, insert, increaseKey, isEmpty, buildMaxHeap, a default constructor (that creates an empty heap), an overloaded constructor that builds a heap out of a provided array (using buildMaxHeap). Note that heapify and buildMaxHeap are private helper functions while others are public.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
