☑Kizspy.me
compare with other motorbike's engine capacity.
2. A MaxHeap class, implemented using an array-based structure, is designed to store
and manage data based on the engine capacities of motorbikes. The class is
responsible for efficiently handling the following operations:
2.1 [0.5 points] Create constructor and necessary parameters to manage array-based
max heap.
2.1 [1.5 points] Create insert method to insert a motorbike into the MaxHeap. It is
required that compareTo method for comparison of motorbikes' engine capacity must
be used to maintain the characteristics of max heap after inserting a new motorbike.
2.2 [0.5 point] Create preOrder Traverse method to traverse the max heap using pre-
order traversal.
Zoom
2.4 [1.5 points] Create delete method to delete a motorbike by its model. It is required
that the characteristics of max heap must be maintained after deleting a motorbike.
+ 100%
Close