Glossary: Data Structures and Algorithms in Java
PriorityQueue
Java's priority queue, a min-heap in an array. `offer` and `poll` are O(log n), `peek` is O(1), and a `Comparator` chooses what counts as smaller.
Glossary: Data Structures and Algorithms in Java
Java's priority queue, a min-heap in an array. `offer` and `poll` are O(log n), `peek` is O(1), and a `Comparator` chooses what counts as smaller.