APCS/09 Heaps/02 HeapPriorityQueue/HeapPriorityQueue.java
Rushil Umaretiya 3fc3554899 initial commit
2020-12-04 22:00:49 -05:00

62 lines
858 B
Java

//Name:
//Date:
import java.util.*;
/* implement the API for java.util.PriorityQueue
* test this class with HeapPriorityQueue_Driver.java.
* test this class with LunchRoom.java.
* add(E) and remove() must work in O(log n) time
*/
public class HeapPriorityQueue<E extends Comparable<E>>
{
private ArrayList<E> myHeap;
public HeapPriorityQueue()
{
myHeap = new ArrayList<E>();
myHeap.add(null);
}
public boolean add(E obj)
{
}
public E remove()
{
}
public E peek()
{
}
public boolean isEmpty()
{
}
private void heapUp(int k)
{
}
private void swap(int a, int b)
{
}
private void heapDown(int k, int size)
{
}
public String toString()
{
return myHeap.toString();
}
}