case class Node[T, HC <: HeapCollector[T, HC]](data: T, left: LeftistHeap[T, HC], right: LeftistHeap[T, HC], _emptyHeap: LeftistHeap[T, HC])(implicit ord: Ordering[T]) extends LeftistHeap[T, HC] with Product with Serializable
Class for non-empty heaps. We also keep a reference to the empty heap to avoid creating new objects (ugly ... there should really be explicit Node-classes for nodes with no or only one child)
- Alphabetic
- By Inheritance
- Node
- Serializable
- Product
- Equals
- LeftistHeap
- Iterable
- IterableFactoryDefaults
- IterableOps
- IterableOnceOps
- IterableOnce
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Node(data: T, left: LeftistHeap[T, HC], right: LeftistHeap[T, HC], _emptyHeap: LeftistHeap[T, HC])(implicit ord: Ordering[T])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(el: T): LeftistHeap[T, HC]
- Definition Classes
- LeftistHeap
- def ++(els: Iterable[T]): LeftistHeap[T, HC]
- Definition Classes
- LeftistHeap
- def ++(els: Iterator[T]): LeftistHeap[T, HC]
- Definition Classes
- LeftistHeap
- final def ++[B >: T](suffix: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val _emptyHeap: LeftistHeap[T, HC]
- final def addString(b: StringBuilder): b.type
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def addString(b: StringBuilder, sep: String): b.type
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- def addString(b: StringBuilder, start: String, sep: String, end: String): b.type
- Definition Classes
- IterableOnceOps
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def className: String
- Attributes
- protected[this]
- Definition Classes
- Iterable
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def coll: Node.this.type
- Attributes
- protected
- Definition Classes
- Iterable → IterableOps
- def collect[B](pf: PartialFunction[T, B]): Iterable[B]
- Definition Classes
- IterableOps → IterableOnceOps
- def collectFirst[B](pf: PartialFunction[T, B]): Option[B]
- Definition Classes
- IterableOnceOps
- lazy val collector: HC
Interface for collecting information about the elements stored in the heap
Interface for collecting information about the elements stored in the heap
- Definition Classes
- Node → LeftistHeap
- def concat[B >: T](suffix: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- def copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Int
- Definition Classes
- IterableOnceOps
- def copyToArray[B >: T](xs: Array[B], start: Int): Int
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecatedOverriding()
- def copyToArray[B >: T](xs: Array[B]): Int
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecatedOverriding()
- def corresponds[B](that: IterableOnce[B])(p: (T, B) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def count(p: (T) => Boolean): Int
- Definition Classes
- IterableOnceOps
- val data: T
- def deleteMin: LeftistHeap[T, HC]
Remove the minimum element from this heap
Remove the minimum element from this heap
- returns
a heap that contains all elements of this heap except for the minimum element
- Definition Classes
- Node → LeftistHeap
- def drop(n: Int): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def dropRight(n: Int): Iterable[T]
- Definition Classes
- IterableOps
- def dropWhile(p: (T) => Boolean): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def empty: Iterable[T]
- Definition Classes
- IterableFactoryDefaults → IterableOps
- def emptyHeap: LeftistHeap[T, HC]
Construct an empty heap
Construct an empty heap
- Attributes
- protected
- Definition Classes
- Node → LeftistHeap
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def exists(p: (T) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def filter(pred: (T) => Boolean): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def filterNot(pred: (T) => Boolean): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def find(p: (T) => Boolean): Option[T]
- Definition Classes
- IterableOnceOps
- def findMin: T
- returns
the minimum element of this heap, or null iff this heap is empty (
isEmpty()==true
)
- Definition Classes
- Node → LeftistHeap
- def findMinOption: Option[T]
- returns
the minimum element of this heap, or
None> iff this heap is empty (
isEmpty()==true
)
- Definition Classes
- LeftistHeap
- def flatItMap(f: (T) => Iterator[T], stop: (LeftistHeap[T, HC]) => Boolean): LeftistHeap[T, HC]
Apply a function
f
to all elements in this heap.Apply a function
f
to all elements in this heap. The heap traversal is skipped for a subheap if the functionstop
applied to this subheap returnstrue
. The functionf
can returnnull
to signal that a data element has not changed.- Definition Classes
- LeftistHeap
- def flatItMapIter(f: (T) => Iterator[T], stop: (LeftistHeap[T, HC]) => Boolean): LeftistHeap[T, HC]
Apply a function
f
to all elements in this heap.Apply a function
f
to all elements in this heap. The heap traversal is skipped for a subheap if the functionstop
applied to this subheap returnstrue
. The functionf
can returnnull
to signal that a data element has not changed.- Definition Classes
- LeftistHeap
- def flatItMapRec(f: (T) => Iterator[T], stop: (LeftistHeap[T, HC]) => Boolean): LeftistHeap[T, HC]
Apply a function
f
to all elements in this heap.Apply a function
f
to all elements in this heap. The heap traversal is skipped for a subheap if the functionstop
applied to this subheap returnstrue
. The functionf
can returnnull
to signal that a data element has not changed.- Definition Classes
- Node → LeftistHeap
- def flatMap[B](f: (T) => IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps → IterableOnceOps
- def flatten[B](implicit asIterable: (T) => IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps → IterableOnceOps
- def fold[A1 >: T](z: A1)(op: (A1, A1) => A1): A1
- Definition Classes
- IterableOnceOps
- def foldLeft[B](z: B)(op: (B, T) => B): B
- Definition Classes
- IterableOnceOps
- def foldRight[B](z: B)(op: (T, B) => B): B
- Definition Classes
- IterableOnceOps
- def forall(p: (T) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def foreach[U](f: (T) => U): Unit
- Definition Classes
- IterableOnceOps
- def fromSpecific(coll: IterableOnce[T]): Iterable[T]
- Attributes
- protected
- Definition Classes
- IterableFactoryDefaults → IterableOps
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def groupBy[K](f: (T) => K): Map[K, Iterable[T]]
- Definition Classes
- IterableOps
- def groupMap[K, B](key: (T) => K)(f: (T) => B): Map[K, Iterable[B]]
- Definition Classes
- IterableOps
- def groupMapReduce[K, B](key: (T) => K)(f: (T) => B)(reduce: (B, B) => B): Map[K, B]
- Definition Classes
- IterableOps
- def grouped(size: Int): Iterator[Iterable[T]]
- Definition Classes
- IterableOps
- def head: T
- Definition Classes
- IterableOps
- def headOption: Option[T]
- Definition Classes
- IterableOps
- def init: Iterable[T]
- Definition Classes
- IterableOps
- def inits: Iterator[Iterable[T]]
- Definition Classes
- IterableOps
- def insert(element: T): LeftistHeap[T, HC]
Add an element to this heap object
Add an element to this heap object
- element
the element to be added
- returns
a heap that contains all elements of this heap, and additionally
element
- Definition Classes
- Node → LeftistHeap
- def insertHeap(h: LeftistHeap[T, HC]): LeftistHeap[T, HC]
Add multiple elements to this heap object
Add multiple elements to this heap object
- h
a heap containing the elements to be added
- returns
a heap that contains all elements of this heap, and additionally all objects from
h
- Attributes
- protected[basetypes]
- Definition Classes
- Node → LeftistHeap
- def insertIt(elements: Iterator[T]): LeftistHeap[T, HC]
Add multiple elements to this heap object
Add multiple elements to this heap object
- elements
the elements to be added
- returns
a heap that contains all elements of this heap, and additionally all objects from
elements
- Definition Classes
- LeftistHeap
- def isEmpty: Boolean
- returns
true iff this heap is empty
- Definition Classes
- Node → LeftistHeap → IterableOnceOps
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraversableAgain: Boolean
- Definition Classes
- IterableOps → IterableOnceOps
- def iterableFactory: IterableFactory[Iterable]
- Definition Classes
- Iterable → IterableOps
- def iterator: Iterator[T]
- Definition Classes
- LeftistHeap → IterableOnce
- def knownSize: Int
- Definition Classes
- IterableOnce
- def last: T
- Definition Classes
- IterableOps
- def lastOption: Option[T]
- Definition Classes
- IterableOps
- def lazyZip[B](that: Iterable[B]): LazyZip2[T, B, Node.this.type]
- Definition Classes
- Iterable
- val left: LeftistHeap[T, HC]
- def map[B](f: (T) => B): Iterable[B]
- Definition Classes
- IterableOps → IterableOnceOps
- def max[B >: T](implicit ord: Ordering[B]): T
- Definition Classes
- IterableOnceOps
- def maxBy[B](f: (T) => B)(implicit ord: Ordering[B]): T
- Definition Classes
- IterableOnceOps
- def maxByOption[B](f: (T) => B)(implicit ord: Ordering[B]): Option[T]
- Definition Classes
- IterableOnceOps
- def maxOption[B >: T](implicit ord: Ordering[B]): Option[T]
- Definition Classes
- IterableOnceOps
- def min[B >: T](implicit ord: Ordering[B]): T
- Definition Classes
- IterableOnceOps
- def minBy[B](f: (T) => B)(implicit ord: Ordering[B]): T
- Definition Classes
- IterableOnceOps
- def minByOption[B](f: (T) => B)(implicit ord: Ordering[B]): Option[T]
- Definition Classes
- IterableOnceOps
- def minOption[B >: T](implicit ord: Ordering[B]): Option[T]
- Definition Classes
- IterableOnceOps
- final def mkString: String
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def mkString(sep: String): String
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def mkString(start: String, sep: String, end: String): String
- Definition Classes
- IterableOnceOps
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newSpecificBuilder: Builder[T, Iterable[T]]
- Attributes
- protected
- Definition Classes
- IterableFactoryDefaults → IterableOps
- def nonEmpty: Boolean
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecatedOverriding()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def partition(p: (T) => Boolean): (Iterable[T], Iterable[T])
- Definition Classes
- IterableOps
- def partitionMap[A1, A2](f: (T) => Either[A1, A2]): (Iterable[A1], Iterable[A2])
- Definition Classes
- IterableOps
- def product[B >: T](implicit num: Numeric[B]): B
- Definition Classes
- IterableOnceOps
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def reduce[B >: T](op: (B, B) => B): B
- Definition Classes
- IterableOnceOps
- def reduceLeft[B >: T](op: (B, T) => B): B
- Definition Classes
- IterableOnceOps
- def reduceLeftOption[B >: T](op: (B, T) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def reduceOption[B >: T](op: (B, B) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def reduceRight[B >: T](op: (T, B) => B): B
- Definition Classes
- IterableOnceOps
- def reduceRightOption[B >: T](op: (T, B) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def removeAll(element: T): LeftistHeap[T, HC]
Remove all elements of this heap which are
equal
toelement
.Remove all elements of this heap which are
equal
toelement
.- returns
heap that has all occurrences of
element
removed
- Definition Classes
- Node → LeftistHeap
- def reversed: Iterable[T]
- Attributes
- protected
- Definition Classes
- IterableOnceOps
- val right: LeftistHeap[T, HC]
- val rightHeight: Int
Length of the right spine, i.e.
Length of the right spine, i.e. the length of the path from the root to rightmost leaf
- Definition Classes
- Node → LeftistHeap
- def scan[B >: T](z: B)(op: (B, B) => B): Iterable[B]
- Definition Classes
- IterableOps
- def scanLeft[B](z: B)(op: (B, T) => B): Iterable[B]
- Definition Classes
- IterableOps → IterableOnceOps
- def scanRight[B](z: B)(op: (T, B) => B): Iterable[B]
- Definition Classes
- IterableOps
- val size: Int
- Definition Classes
- Node → IterableOnceOps
- def sizeCompare(that: Iterable[_]): Int
- Definition Classes
- IterableOps
- def sizeCompare(otherSize: Int): Int
- Definition Classes
- IterableOps
- final def sizeIs: SizeCompareOps
- Definition Classes
- IterableOps
- Annotations
- @inline()
- def slice(from: Int, until: Int): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def sliding(size: Int, step: Int): Iterator[Iterable[T]]
- Definition Classes
- IterableOps
- def sliding(size: Int): Iterator[Iterable[T]]
- Definition Classes
- IterableOps
- def sortedIterator: Iterator[T]
- returns
an iterator that returns all elements of this heap in increasing order
- Definition Classes
- LeftistHeap
- def span(p: (T) => Boolean): (Iterable[T], Iterable[T])
- Definition Classes
- IterableOps → IterableOnceOps
- def splitAt(n: Int): (Iterable[T], Iterable[T])
- Definition Classes
- IterableOps → IterableOnceOps
- def stepper[S <: Stepper[_]](implicit shape: StepperShape[T, S]): S
- Definition Classes
- IterableOnce
- def stringPrefix: String
- Attributes
- protected[this]
- Definition Classes
- Iterable
- Annotations
- @deprecatedOverriding()
- def sum[B >: T](implicit num: Numeric[B]): B
- Definition Classes
- IterableOnceOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tail: Iterable[T]
- Definition Classes
- IterableOps
- def tails: Iterator[Iterable[T]]
- Definition Classes
- IterableOps
- def take(n: Int): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def takeRight(n: Int): Iterable[T]
- Definition Classes
- IterableOps
- def takeWhile(p: (T) => Boolean): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def tapEach[U](f: (T) => U): Iterable[T]
- Definition Classes
- IterableOps → IterableOnceOps
- def to[C1](factory: Factory[T, C1]): C1
- Definition Classes
- IterableOnceOps
- def toArray[B >: T](implicit arg0: ClassTag[B]): Array[B]
- Definition Classes
- IterableOnceOps
- final def toBuffer[B >: T]: Buffer[B]
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- def toIndexedSeq: IndexedSeq[T]
- Definition Classes
- IterableOnceOps
- def toList: List[T]
- Definition Classes
- IterableOnceOps
- def toMap[K, V](implicit ev: <:<[T, (K, V)]): Map[K, V]
- Definition Classes
- IterableOnceOps
- def toSeq: Seq[T]
- Definition Classes
- IterableOnceOps
- def toSet[B >: T]: Set[B]
- Definition Classes
- IterableOnceOps
- def toString(): String
- Definition Classes
- LeftistHeap → Iterable → AnyRef → Any
- def toVector: Vector[T]
- Definition Classes
- IterableOnceOps
- def transpose[B](implicit asIterable: (T) => Iterable[B]): Iterable[Iterable[B]]
- Definition Classes
- IterableOps
- def unsortedIterator: Iterator[T]
- returns
an iterator that returns all elements of this heap
- Definition Classes
- LeftistHeap
- def unzip[A1, A2](implicit asPair: (T) => (A1, A2)): (Iterable[A1], Iterable[A2])
- Definition Classes
- IterableOps
- def unzip3[A1, A2, A3](implicit asTriple: (T) => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])
- Definition Classes
- IterableOps
- def view: View[T]
- Definition Classes
- IterableOps
- 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])
- def withFilter(p: (T) => Boolean): WithFilter[T, Iterable]
- Definition Classes
- IterableOps
- def zip[B](that: IterableOnce[B]): Iterable[(T, B)]
- Definition Classes
- IterableOps
- def zipAll[A1 >: T, B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]
- Definition Classes
- IterableOps
- def zipWithIndex: Iterable[(T, Int)]
- Definition Classes
- IterableOps → IterableOnceOps
Deprecated Value Members
- def ++:[B >: T](that: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use ++ instead of ++: for collections of type Iterable
- final def /:[B](z: B)(op: (B, T) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use foldLeft instead of /:
- final def :\[B](z: B)(op: (T, B) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use foldRight instead of :\
- def aggregate[B](z: => B)(seqop: (B, T) => B, combop: (B, B) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) For sequential collections, prefer
foldLeft(z)(seqop)
. For parallel collections, useParIterableLike#aggregate
.
- def companion: IterableFactory[Iterable]
- Definition Classes
- IterableOps
- Annotations
- @deprecated @deprecatedOverriding() @inline()
- Deprecated
(Since version 2.13.0) Use iterableFactory instead
- final def copyToBuffer[B >: T](dest: Buffer[B]): Unit
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use
dest ++= coll
instead
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def hasDefiniteSize: Boolean
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
- final def repr: Iterable[T]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use coll instead of repr in a collection implementation, use the collection value itself from the outside
- def seq: Node.this.type
- Definition Classes
- Iterable
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Iterable.seq always returns the iterable itself
- final def toIterable: Node.this.type
- Definition Classes
- Iterable → IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.7) toIterable is internal and will be made protected; its name is similar to
toList
ortoSeq
, but it doesn't copy non-immutable collections
- final def toIterator: Iterator[T]
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use .iterator instead of .toIterator
- final def toStream: Stream[T]
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use .to(LazyList) instead of .toStream
- final def toTraversable: Traversable[T]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) toTraversable is internal and will be made protected; its name is similar to
toList
ortoSeq
, but it doesn't copy non-immutable collections
- def view(from: Int, until: Int): View[T]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use .view.slice(from, until) instead of .view(from, until)