Class Deque<T>Internal

Deque. Implemented with a doubly linked list.

Type Parameters

  • T

    Type of deque data.

Constructors

Properties

maxSize: number

The maximum size of the deque.

size: number

The size of the deque.

Methods

  • Peeks at the first data.

    Returns undefined | T

    The first data or undefined if the deque is empty.

  • Peeks at the last data.

    Returns undefined | T

    The last data or undefined if the deque is empty.

  • Pops data from the deque.

    Returns undefined | T

    The popped data or undefined if the deque is empty.

  • Appends data to the deque.

    Parameters

    • data: T

      Data to append.

    Returns number

    The new size of the deque.

  • Shifts data from the deque.

    Returns undefined | T

    The shifted data or undefined if the deque is empty.

  • Prepends data to the deque.

    Parameters

    • data: T

      Data to prepend.

    Returns number

    The new size of the deque.

Generated using TypeDoc