Priority Queue with explicit priority
Hello, this is my first post.
I'm currenty implementing, for an university project a priority queue, to be used with the dijkstra algorithm. For the project the queque must have only this public methods:
- creation of an empty code, specifying the length
- isEmpty() checks if the queue is empty
- add(u,d) inserts a node u with priority d
- deleteMin() returns (and deletes from the queue)the node with minumum distance
- changePriority(u,d) changes the priority of u with d
all the literature I've found uses only a variable to add an element to the queue, so I'm quite stuck. (ok, maybe I'm only dumb and I cannot adapt it to my case)
Someone have an advice?
thank you in advance