Fixing inefficient creation of comparator every time in MinHeap