@zhelvis/structure-ts
    Preparing search index...

    Class Queue<T>

    A FIFO implementation using a doubly linked list.

    Type Parameters

    • T
    Index

    Constructors

    • Creates a new Queue instance optionally initialized with items.

      Type Parameters

      • T

      Parameters

      • Optionalitems: T[]

        Optional array of items to enqueue at construction.

      Returns Queue<T>

    Methods

    • Returns an iterator for the queue, iterating from front to end.

      Returns Iterator<T>

      Iterator for the queue values.

    • Removes and returns the item at the front of the queue.

      Returns undefined | T

      The dequeued value, or undefined if the queue is empty.

    • Adds an item to the end of the queue.

      Parameters

      • value: T

        The value to enqueue.

      Returns void