Implemention of a priority queue, the use of it to implement the heapsort algorithm