If the number of possible priorities is small and fixed, as in an operating system, an array of queues can be used, with the priority being the array index.

If there are many possible priority values, an easy way to implement a priority queue is to use a binary search tree such as an AVL tree, indexed by priority, with a queue at the leaves.

This makes both ` insert` and ` deleteMin` be *O(log(n))*.

However, we can do slightly better with less cumbersome machinery.