Does a priority queue Queue<K,V>
always sort its elements based on the value of each element or its key?
I know than the priority in the queue is based on the key, and that the element with the highest priority has the minimal key (Correct me if I am wrong) But I am not sure about wether the pq sorts based on value.
Queue<K,V>
, which should specify the semantics of the data structure. $\endgroup$