I take the full realization of priority queue from golang docs. I'm interesting in removing several elements at once like heap.Remove(&queue, index1, index2, ...)
.
Now it can be done in the straightforward way:
for _, event := range events {
heap.Remove(&queue, event.getIndex())
}
But this method has an overhead because every call to heap.Remove
reorganizes tree. It seems more efficient if we can remove all unnecessary elements firstly and only then reorganize tree.
How it can be implemented?