Priority queue implementation using a binary heap

Type Parameters

  • T

Constructors

Methods

  • Returns the first element in the queue that satisfies the provided testing function. Otherwise, undefined is returned.

    Parameters

    • predicate: (value: T) => boolean

      A function to test each element of the queue

    Returns undefined | T

  • Returns the element at the top of the queue, without removing it from the queue

    Returns undefined | T

  • Adds one or more elements to the queue

    Parameters

    • ...values: T[]

      The elements to add to the queue

    Returns number

    The new size of the queue