The comparison function for handling priorities, so the user can choose whether to use a min-heap (i.e. ascending PQ) or a max-heap (i.e. descending PQ). a min-heap, the comparison function should return a negative value if a < b. For a max-heap, the comparison function should return a positive value if a < b.
The comparison function for handling priorities, so the user can choose whether to use a min-heap (i.e. ascending PQ) or a max-heap (i.e. descending PQ). a min-heap, the comparison function should return a negative value if a < b. For a max-heap, the comparison function should return a positive value if a < b.