Tree implementation of binary heap(priority queue)