In this commit I have:

Added JavaDoc to every package except for "heaps"
This commit is contained in:
zacharyjones123
2017-04-18 07:57:17 -07:00
parent 94871b7e6a
commit 9411d5be56
29 changed files with 1406 additions and 425 deletions

View File

@@ -87,7 +87,13 @@ public class MinHeap implements Heap {
@Override
public void deleteElement(int elementIndex) {
if (isempty(maxHeap)) throw new EmptyHeapException("Attempt to delete an element from an empty heap");
if (minHeap.isEmpty())
try {
throw new EmptyHeapException("Attempt to delete an element from an empty heap");
} catch (EmptyHeapException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if ((elementIndex > minHeap.size()) && (elementIndex <= 0)) throw new IndexOutOfBoundsException("Index out of heap range");
// The last element in heap replaces the one to be deleted
minHeap.set(elementIndex - 1, getElement(minHeap.size()));