diff --git a/lab10/ArrayHeap.java b/lab10/ArrayHeap.java index 2557a42..b1931db 100755 --- a/lab10/ArrayHeap.java +++ b/lab10/ArrayHeap.java @@ -256,7 +256,7 @@ public String toString() { /** Helper function to resize the backing array when necessary. */ private void resize(int capacity) { Node[] temp = new ArrayHeap.Node[capacity]; - for (int i = 1; i <= temp.length; i++) { + for (int i = 1; i < contents.length; i++) { temp[i] = contents[i]; } contents = temp;