Yuval Adam Yuval Adam - 5 months ago 32
Java Question

Java implementation for Min-Max Heap?

Do you know of a popular library (apache collections, google collections, etc...) which has a reliable Java implementation for a Min-Max heap?

I.e. a heap which allows to peek at its minimum and maximum value in

O(1)
and to remove at
O(logn)
.

I did a quick search and couldn't find one. Anyone know better?

Answer

From Guava: MinMaxPriorityQueue.

Comments