PriorityQueue<T> constructor
- int compare(
- T,
- T
Creates an empty PriorityQueue.
By default, it expects T to be Comparable to create a max-heap.
You can provide a custom compare function to define priority.
Implementation
PriorityQueue([int Function(T, T)? compare])
: _compare = compare ?? _defaultCompare;