priorityqueue
    Preparing search index...

    Type Alias PriorityQueueInstance<T>

    Instance interface of Priority Queue.

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

    Type Parameters

    • T

    Implemented by

    Index

    Properties

    clear: () => void

    Clear this priority queue.

    comparator: Comparator<T>
    isEmpty: () => boolean

    Returns the priority queue is empty or not.

    merge: <Instance extends PriorityQueueInstance<T>>(_other: Instance) => void

    Merge another priority queue into this.

    pop: () => T

    Pop the top element of the priority queue.

    push: (_value: T) => void

    Push the element to the priority queue and returns self.

    toArray: () => T[]

    Write out the priority queue content as an Array.

    top: () => T

    Get the top element of the priority queue.

    Accessors

    • get length(): number

      Returns size of the priority queue.

      Returns number