Heap Practice Quiz

Practice Problem

public class MaxHeap<E> {
  private E[] heap;
  private Comparator<E> c;
  private int size;

  /**
   * Re-heap the heap so that the largest value is on top of 
   * the heap. Assume the new item is at size - 1.
   */
  private void reHeap() {
   // your code
  }
  
}

Time Remaining:

You can restart the timer by reloading the page.

Try to complete the problem in 15 minutes.

If you cannot complete the program in 15 minutes, you can watch me solve the problem in a text editor.