A priority queue using heapsort and an array