I am having trouble extracting the minimum value from a min heap, I am using vectors, for some reason the pop_back() function is not working...here is my code
Now the program is crashing, it says 'vector subscript out of range' the problem seems to be bubbleDown(0) inside the extractMin function, it does not crash when I comment it out.
Vector subscript out of range means that you are trying to access elements in the vector that doesn't exist. In bubble up/down you should think about what happens if the item does not have a parent or a left or right child.