Options
All
  • Public
  • Public/Protected
  • All
Menu
class

PriorityQueue a min priority queue backed by a pairing heap

Type parameters

  • T

Hierarchy

  • PriorityQueue

Index

Constructors

constructor

  • Parameters

    • lessThan: function
        • (a: T, b: T): boolean
        • Parameters

          • a: T
          • b: T

          Returns boolean

    Returns PriorityQueue

Properties

Private lessThan

lessThan: function

Type declaration

    • (a: T, b: T): boolean
    • Parameters

      • a: T
      • b: T

      Returns boolean

Private root

root: PairingHeap<T>

Methods

count

  • count(): number
  • method

    count

    Returns number

    number of elements in queue

empty

  • empty(): boolean
  • method

    empty

    Returns boolean

    true if no more elements in queue

forEach

  • forEach(f: any): void
  • method

    forEach apply f to each element of the queue

    Parameters

    • f: any

      function to apply

    Returns void

isHeap

  • isHeap(): boolean
  • method

    isHeap check heap condition (for testing)

    Returns boolean

    true if queue is in valid state

pop

  • pop(): T
  • method

    pop remove and return the min element from the queue

    Returns T

push

reduceKey

  • reduceKey(heapNode: PairingHeap<T>, newKey: T, setHeapNode?: function): void
  • method

    reduceKey reduce the key value of the specified heap node

    Parameters

    Returns void

toString

  • toString(selector: any): string
  • Parameters

    • selector: any

    Returns string

top

  • top(): T
  • method

    top

    Returns T

    the top element (the min element as defined by lessThan)

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc