PrioQueue

com.phasmidsoftware.visitor.core.PrioQueue
See thePrioQueue companion object
case class PrioQueue[T]

An immutable priority queue ADT backed by BinaryHeap.

Duplicates are permitted. The minimum element is dequeued first (or maximum via PrioQueue.emptyMax).

Ordering[T] is captured at construction time so that Frontier[PrioQueue] remains fully polymorphic — no Ordering context is needed at offer / take call sites.

For a priority queue that also supports O(log n) decreaseKey, see IndexedPrioQueue.

Type parameters

T

the element type

Value parameters

heap

the underlying binary heap

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def head: T
def isEmpty: Boolean
def offer(t: T): PrioQueue[T]
def size: Int
def take: (T, PrioQueue[T])

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product