Suppose items with priorities
3, 10, 1, 4, 16, 14, 9, 7, and
8
are to be stored in a priority queue.
Suppose the lowest-key items are to be removed first.
We can use an array sorted by key:
Note that only the key is shown. Each item's data would also be stored in
the array.