Implementation of PriorityQueue class - my work.