Class/Object

dogs

Heap

Related Docs: object Heap | package dogs

Permalink

sealed abstract class Heap[A] extends AnyRef

Binary Heap

Normally, binary heaps are not common the functional environments since they implementationis based on mutable arrays. However, this implementation is purely functional, based on the VLADIMIR KOSTYUKOV paper.

It is important to note that we can, in fact, to create the Binary Heap in order O(n) from a List using the function heapify.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Heap
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getMin: Option[A]

    Permalink

    Returns min value on the heap.

  2. abstract def height: Int

    Permalink

    Returns the height of the heap.

  3. abstract def isEmpty: Boolean

    Permalink

    Verfies if the heap is empty.

  4. abstract def size: Int

    Permalink

    Returns the size of the heap.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(x: A)(implicit order: Order[A]): Heap[A]

    Permalink

    Alias for add

  4. def --(implicit order: Order[A]): Heap[A]

    Permalink

    Alias for remove

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def add(x: A)(implicit order: Order[A]): Heap[A]

    Permalink

    Insert a new element into the heap.

    Insert a new element into the heap. Order O(log n)

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def heapify(a: List[A])(implicit order: Order[A]): Heap[A]

    Permalink

    Build a heap using a list.

    Build a heap using a list. Order O(n)

  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def remove()(implicit order: Order[A]): Heap[A]

    Permalink

    Remove the min element from the heap (the root).

    Remove the min element from the heap (the root). Order O(log n)

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toList()(implicit order: Order[A]): List[A]

    Permalink

    Returns a sorted list of the elements within the heap.

  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped