A priority queue is a collection of elements, called values, each having an associated key that is provided at the time the element is inserted.

A key-value pair inserted into a priority queue is called an entry. Keys are parameters or properties according to which we can compare the objects; keys are assigned for each object in a collection, for example we can compare companies by earnings or by number of employees.

Formally: a key is an object that is assigned to an element as a specific attribute for that element, which can be used to identify or weight that element.