PairingHeap

cats.collections.PairingHeap$
See thePairingHeap companion class

Attributes

Companion:
class
Source:
PairingHeap.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source:
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

def apply[A](x: A): PairingHeap[A]

Attributes

Source:
PairingHeap.scala

This is thought to be O(log N) where N is the size of the final heap

This is thought to be O(log N) where N is the size of the final heap

Attributes

Source:
PairingHeap.scala
def empty[A]: PairingHeap[A]

Attributes

Source:
PairingHeap.scala
def fromIterable[A](as: Iterable[A])(implicit order: Order[A]): PairingHeap[A]

build a heap from a list of items, O(N)

build a heap from a list of items, O(N)

Attributes

Source:
PairingHeap.scala
def takeLargest[A](as: Iterable[A], count: Int)(implicit order: Order[A]): PairingHeap[A]

this is useful for finding the k maximum values in O(N) times for N items same as as.toList.sorted.reverse.take(count), but O(N log(count)) vs O(N log N) for a full sort. When N is very large, this can be a very large savings

this is useful for finding the k maximum values in O(N) times for N items same as as.toList.sorted.reverse.take(count), but O(N log(count)) vs O(N log N) for a full sort. When N is very large, this can be a very large savings

Attributes

Source:
PairingHeap.scala

Implicits

Implicits

This is the same order as you would get by doing .toList and ordering by that

This is the same order as you would get by doing .toList and ordering by that

Attributes

Source:
PairingHeap.scala
implicit def toShowable[A](implicit s: Show[A], order: Order[A]): Show[PairingHeap[A]]

Attributes

Source:
PairingHeap.scala