In Remove() there are two index variables (amongst others variables):
index which is the index of the given element in the element list.
openLoc which is the index of said element in the heap.
The function KeyChanged() expects the index of the element whose key was changed.
Remove() calls KeyChanged(), but calls it with openLoc instead of index, which is what should be sent.
Therefore, I changed the call to use index instead of openLoc.
In Remove() there are two index variables (amongst others variables):
The function KeyChanged() expects the index of the element whose key was changed. Remove() calls KeyChanged(), but calls it with openLoc instead of index, which is what should be sent. Therefore, I changed the call to use index instead of openLoc.