package mutable
- Alphabetic
- Public
- Protected
Type Members
- trait Heap[A] extends Cloneable[Heap[A]]
D-way Heap
D-way Heap
The default branching factor is four, which might work in most cases. To create a heap with a different branching factor, use Heap.withBranchingFactor.
There must be implicit scala.math.Ordering available at creation for prioritizing elements. An element with higher order is considered a higher priority.
It's not allowed to insert the same elements. Two elements are considered the same if both have the same hash code. If the same element is inserted, the existing one will be removed. In this case, the priority of the element will update if the new element has a different priority.
As some limitations applied, this heap supports removing the element from any position on logarithmic time.
- A
The type of elements in the heap
- final class HeapFactory extends AnyVal
Builds a Heap with the given branching factor
Builds a Heap with the given branching factor
This class extends scala.AnyVal to avoid object allocation when using Heap.withBranchingFactor.
Value Members
- object Heap extends SortedIterableFactory[Heap]
Building a Heap (D-way heap)
- object HeapFactory