Heap

cats.collections.Heap$
See theHeap companion class
object Heap

Attributes

Companion:
class
Source:
Heap.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Heap.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): Heap[A]

Attributes

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

Attributes

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

alias for heapify

alias for heapify

Attributes

Source:
Heap.scala
def heapify[A](a: Iterable[A])(implicit order: Order[A]): Heap[A]

Build a heap using an Iterable Order O(n)

Build a heap using an Iterable Order O(n)

Attributes

Source:
Heap.scala
def takeLargest[A](as: Iterable[A], count: Int)(implicit order: Order[A]): Heap[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:
Heap.scala

Implicits

Implicits

implicit def catsCollectionHeapOrder[A : Order]: Order[Heap[A]]

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:
Heap.scala
implicit def toShowable[A](implicit s: Show[A], order: Order[A]): Show[Heap[A]]

Attributes

Source:
Heap.scala