I'm trying to create an integer array that represents a heap.
I am almost finished, but still have two little problems.
when I remove an item, I set the heap to replace the removed item with the last item of the array and then call a method to re-organize the heap.
problem is that I can't seem to do it well, so any tips are welcome.
second problem is that since it is an integer array I had to make up a rule that if the number 0 occupies a spot in the heap, it means there is nothing there, but I want to be able to add the number 0 to the heap, so how can I fix that?
thanks