sealed abstract
class
Heap[A] extends AnyRef
Abstract Value Members
-
abstract
def
getMin: Option[A]
-
abstract
def
height: Int
-
abstract
def
isEmpty: Boolean
-
abstract
def
size: Int
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+(x: A)(implicit order: Order[A]): Heap[A]
-
def
--(implicit order: Order[A]): Heap[A]
-
final
def
==(arg0: Any): Boolean
-
def
add(x: A)(implicit order: Order[A]): Heap[A]
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
def
heapify(a: List[A])(implicit order: Order[A]): Heap[A]
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
remove()(implicit order: Order[A]): Heap[A]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toList()(implicit order: Order[A]): List[A]
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
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 functionheapify
.