Options
All
  • Public
  • Public/Protected
  • All
Menu

Generic priority queue.

Type parameters

  • T

    type of element to be stored on the queue.

Hierarchy

  • PriorityQueue

Implements

  • Iterator<T>

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Readonly isLess

isLess: Relation<T>

Accessors

size

  • get size(): number

Methods

add

  • add(value: T): this

clear

  • clear(): void

next

  • next(): IteratorResult<T>
  • Removes and returns the first element in the queue.

    Returns IteratorResult<T>

    the first element in the queue.

peek

  • peek(): T | undefined

Static from

  • Creates a priority queue from an iterable.

    Type parameters

    • T

    Parameters

    • iterable: Iterable<T> | T[]

      iterable for the elements to be added.

    • Default value isLess: Relation<T> = (a, b) => a < b

      strict total order in T.

    Returns PriorityQueue<T>

Generated using TypeDoc