min priority queue implemented by using a heap