Class PriorityQueue<T>

Type Parameters

  • T

Hierarchy

Constructors

  • Description

    PriorityQueue's constructor.

    Type Parameters

    • T

    Parameters

    • container: initContainer<T> = []

      Initialize container, must have a forEach function.

    • cmp: ((x: T, y: T) => number) = ...

      Compare function.

        • (x: T, y: T): number
        • Parameters

          • x: T
          • y: T

          Returns number

    • copy: boolean = true

      When the container is an array, you can choose to directly operate on the original object of the array or perform a shallow copy. The default is shallow copy.

    Returns PriorityQueue<T>

Methods

Generated using TypeDoc