Type alias PriorityQueueInstance<T>

PriorityQueueInstance<T>: {
    clear: (() => void);
    comparator: Comparator<T>;
    isEmpty: (() => boolean);
    merge: (<Instance>(_other: Instance) => void);
    pop: (() => T);
    push: ((_value: T) => void);
    toArray: (() => T[]);
    top: (() => T);
    get length(): number;
}

Instance interface of Priority Queue.

Type Parameters

  • T

Type declaration

  • clear: (() => void)
      • (): void
      • Clear this priority queue.

        Returns void

  • comparator: Comparator<T>
  • isEmpty: (() => boolean)
      • (): boolean
      • Returns the priority queue is empty or not.

        Returns boolean

  • merge: (<Instance>(_other: Instance) => void)
      • <Instance>(_other: Instance): void
      • Merge another priority queue into this.

        Type Parameters

        Parameters

        • _other: Instance

        Returns void

  • pop: (() => T)
      • (): T
      • Pop the top element of the priority queue.

        Returns T

  • push: ((_value: T) => void)
      • (_value: T): void
      • Push the element to the priority queue and returns self.

        Parameters

        • _value: T

        Returns void

  • toArray: (() => T[])
      • (): T[]
      • Write out the priority queue content as an Array.

        Returns T[]

  • top: (() => T)
      • (): T
      • Get the top element of the priority queue.

        Returns T

  • get length(): number

    Returns size of the priority queue.

Generated using TypeDoc