Add support for updating priority of entry
Since I'm trying to implement Dijkstra's algorithm, I want to be able to update the priority of an already existing entry in the queue.
BTW, while having a direct method to update priority of an existing value will be ideal, it may be costly — for Dijkstra, a simpler approach may be to just add a duplicate node. Once we pop a node (which means it's the highest priority), any subsequent duplicates can be ignored.
I have an application where the update is changing the points priority in the other direction (ie increasing the priority of some points). To solve this I maintain an external array of priorities. When I pop a value, if its priority in the queue doesn't match the priority in the array (in other words, if it has been modified), I ignore it and push it back with the updated value.