parameterize `BinaryHeap` with a comparator