Question: I need help completing this code in java because I have no clue how to do it. package singlecorescheduler; import java.util.*; /** * */ public
I need help completing this code in java because I have no clue how to do it.
package singlecorescheduler;
import java.util.*;
/** * */ public class Heap
}
public boolean isEmpty() { // implement this method return size() == 0; }
public void insert(E obj) { //implement this method }
public E remove() throws HeapException { //implement this method return } public E peek() throws HeapException { //implement this method }
public int size() { //implement this method return size; } /** * Swaps a parent and child elements of this heap at the specified indices * @param place an index of the child element on this heap * @param parent an index of the parent element on this heap */ private void swap(int place, int parent) { //implement this method }
/** * Rebuilds the heap to ensure that the heap property of the tree is preserved. * @param root the root index of the subtree to be rebuilt * @param eSize the size of this tree */ private void rebuild(int root, int eSize) { //implement this method
} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
