Search code examples
javadata-structuresminmax-heap

Java implementation for Min-Max Heap?


Do you know of a popular library (Apache, Google, etc, collections) which has a reliable Java implementation for a min-max heap, that is a heap which allows to peek its minimum and maximum value in O(1) and to remove an element in O(log n)?


Solution

  • From Guava: MinMaxPriorityQueue.