Fix BinaryHeap/Search trees and associated tests.

This commit is contained in:
2018-03-26 12:27:57 +02:00
parent aab8743d3c
commit c5518e7240
3 changed files with 91 additions and 9 deletions

View File

@@ -150,7 +150,7 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
@Override
public E findMin() throws EmptyPriorityQueueException {
if (isEmpty())
throw new RuntimeException("Empty binary heap.");
throw new EmptyPriorityQueueException();
return this.array.get(0);
}