A priority queue is an abstract data type (ADT) which defines a container for a set of elements, each of which has an associated "priority". The ADT specifies a method to access the highest priority element, which can be either a minimum or a maximum.
A priority queue is an abstract data type (ADT) which defines a container for a set of elements, each of which has an associated "priority". The ADT specifies a method to access the highest priority element, which can be either a minimum or a maximum. Binary heaps are a common choice from amongst the many possible implementations. Note: the priority queue ADT does not guarantee any particular ordering for the set of elements, so ready access to elements other than the highest priority one is not guaranteed to be efficient or even available.