Class Queue<T>

Queue data structure implemented with a linked list for efficient O(1) enqueue and dequeue operations. Supports standard queue operations such as enqueue, dequeue, and peek.

Type Parameters

  • T

    The type of elements held in the queue.

Constructors

Accessors

Methods

Constructors

Accessors

Methods

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

    Returns T

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

  • Returns the element at the front of the queue without removing it.

    Returns T

    The value at the front, or undefined if the queue is empty.