I have an array-based binary heap used for graph searching (though the purpose is irrelevant).
(The item at index 0 is the top of the heap.)
Every once in a while, the item at the top of the heap satisfies the criterion that I'm seeking, and thus I pop it and save it for later use.
Currently, I'm just putting these found items in a separate array and returning them to the user.
However, I'm wondering: is there any efficient way for me to keep the item in the front of the original array, by somehow simply readjusting the bounds of the "active" portion of the heap somehow (i.e., shifting the starting boundary of the active portion by one element) and keep going until I'm done?
Doing this naively messes up the structure of the heap.