Skewheaps are fun, weird, priority queues that self-balance over time. Their structural depth is not guaranteed and individual operations may vary in performance. That said, its amortized performance is roughly O(log n) (source).
Skewheaps' most interesting characteristic is that they can be very quickly merged together non-destructively, creating a new, balanced heap containing all elements of the source heaps.
See Skew_heap on Wikipedia.
- Add skewheap to your project's dependencies
def deps do
[{:skewheap, "~> 0.5.1"}]
end
- Install
$ mix deps.get
API documentation available on https://hexdocs.pm/skewheap.