Packages

trait Heap[A] extends IterableOnce[A]

D-way Heap

See also

algo.data.heap.mutable.Heap

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Heap
  2. IterableOnce
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def branchingFactor: Int

    Returns the branching factor of this heap

    Returns the branching factor of this heap

    Note

    Time Complexity: O(1)

  2. abstract def clear(): Heap[A]

    Removes all elements from this heap

    Removes all elements from this heap

    Note

    Time Complexity: O(1)

  3. 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)

  4. abstract def isEmpty: Boolean

    Returns true if this heap is empty

    Returns true if this heap is empty

    Note

    Time Complexity: O(1)

  5. abstract def iterator: Iterator[A]
    Definition Classes
    IterableOnce
  6. 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)

  7. abstract def ordering: Ordering[A]

    Returns the ordering of this heap

    Returns the ordering of this heap

    Note

    Time Complexity: O(1)

  8. 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

  9. 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)

  10. 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

  11. 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

  12. 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)

  13. abstract def size: Int

    Returns the size of this heap

    Returns the size of this heap

    Note

    Time Complexity: O(1)

  14. abstract def to[C](factory: Factory[A, C]): C

    Build a collection from this heap

  15. 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)

  16. 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)

  17. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def knownSize: Int
    Definition Classes
    IterableOnce
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S
    Definition Classes
    IterableOnce
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from IterableOnce[A]

Inherited from AnyRef

Inherited from Any

Ungrouped