Courses‎ > ‎AP Computer Science 2‎ > ‎Konstantinovich‎ > ‎

2017-05-03 Heap

posted May 3, 2017, 9:33 AM by Samuel Konstantinovich
Update github as follows:


You are writing a heap of strings, it is very easy to modify this to be a heap of anything else.

 -MyHeap() - construct empty max heap
 -MyHeap(boolean) - true: construct empty max heap, false: construct empty min heap.
 -void add(String s)
 -String remove()
 -String peek()

Private methods: