trait Heap[A] extends IterableOnce[A]
- Alphabetic
- By Inheritance
- Heap
- IterableOnce
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def branchingFactor: Int
Returns the branching factor of this heap
Returns the branching factor of this heap
- Note
Time Complexity: O(1)
- abstract def clear(): Heap[A]
Removes all elements from this heap
Removes all elements from this heap
- Note
Time Complexity: O(1)
- abstract def contains(value: A): Boolean
Returns true if this heap contains the given value
Returns true if this heap contains the given value
- Note
Time Complexity: O(1)
- abstract def isEmpty: Boolean
Returns true if this heap is empty
Returns true if this heap is empty
- Note
Time Complexity: O(1)
- abstract def iterator: Iterator[A]
- Definition Classes
- IterableOnce
- abstract def nonEmpty: Boolean
Returns true if this heap is not empty
Returns true if this heap is not empty
- Note
Time Complexity: O(1)
- abstract def ordering: Ordering[A]
Returns the ordering of this heap
Returns the ordering of this heap
- Note
Time Complexity: O(1)
- abstract def pop(): (A, Heap[A])
Removes and returns the element with the highest priority from this heap
Removes and returns the element with the highest priority from this heap
- Exceptions thrown
java.util.NoSuchElementException
if this heap is empty- Note
Time Complexity: O(log n) amortized
- abstract def popAll(): (IndexedSeq[A], Heap[A])
Removes and returns all elements in priority order from this heap
Removes and returns all elements in priority order from this heap
- Note
Time Complexity: O(n log n)
- abstract def push(value: A): Heap[A]
Inserts the given value into this heap
Inserts the given value into this heap
If the given value already exists in this heap, the element will be inserted again. The existing one will be removed.
- Note
Time Complexity: O(log n) amortized
- abstract def remove(value: A): Heap[A]
Removes the give value from this heap
Removes the give value from this heap
If the given value is not in this heap, this method does nothing.
- Note
Time Complexity: O(log n) amortized
- abstract def reverse: Heap[A]
Returns the reverse of this heap
Returns the reverse of this heap
The reversed heap has the same elements of this heap, but the reverse ordering.
- Note
Time Complexity: O(n)
- abstract def size: Int
Returns the size of this heap
Returns the size of this heap
- Note
Time Complexity: O(1)
- abstract def to[C](factory: Factory[A, C]): C
Build a collection from this heap
- abstract def top: A
Returns the element with the highest priority of this heap
Returns the element with the highest priority of this heap
- Exceptions thrown
java.util.NoSuchElementException
if this heap is empty- Note
Time Complexity: O(1)
- abstract def topOption: Option[A]
Returns the element with the highest priority of this heap
Returns the element with the highest priority of this heap
If this heap is empty, returns scala.None.
- Note
Time Complexity: O(1)
- abstract def update(oldValue: A, newValue: A): Heap[A]
Removes the old value from this heap and inserts the new value into this heap
Removes the old value from this heap and inserts the new value into this heap
update(oldValue,newValue)
is equivalent to the following calls but more efficient:remove(oldValue) push(newValue)
If the old value is not in this heap, this method skips the removal. If the new value already exists in this heap, this method inserts the new element again and removes the existing one.
- Note
Time Complexity: O(log n) amortized
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def knownSize: Int
- Definition Classes
- IterableOnce
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S
- Definition Classes
- IterableOnce
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])