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

2017-05-03 Heap

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

/12/ExpressionTree.java

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

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

Private methods:
 -pushUp()
 -pushDown()
Comments