Class Queue<T>

Queue

Type Parameters

  • T

    Type of queue items.

Hierarchy

  • Queue

Constructors

Properties

items: T[]
maxSize: number

The maximum size of the queue.

offset: number
size: number

The size of the queue.

Methods

  • Dequeue an item.

    Returns undefined | T

    The dequeued item or undefined if the queue is empty.

  • Enqueue an item.

    Parameters

    • item: T

      Item to enqueue.

    Returns number

    The new size of the queue.

  • Peeks at the first item.

    Returns undefined | T

    The first item or undefined if the queue is empty.

Generated using TypeDoc