Support insertion of prioritized jobs in queue.
Support extraction of highest priority job from queue.
Using heaps:
ExtractMax(S) 1 max = A[1] 2 A[1] = A[HeapSize(A)] 3 HeapSize(A) = HeapSize(A) - 1 4 Heapify(A,1) 5 return max
This corresponds roughly to one iteration of HeapSort.