Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • Queue

Index

Constructors

Properties

head: null | SinglyLinkedNode<T>
size: number
tail: null | SinglyLinkedNode<T>

Methods

  • [iterator](): Generator<T, void, unknown>
  • Implement the iterable protocol

    Returns Generator<T, void, unknown>

  • dequeue(): null | T
  • Removes and returns the first element in the queue

    Time complexity: O(1) Space complexity: O(1)

    Returns null | T

  • enqueue(value: T): number
  • Adds element to the end of the queue

    Time complexity: O(1) Space complexity: O(1)

    Parameters

    • value: T

    Returns number

  • toString(): string
  • Overrides the generic toString method

    Time complexity: O(n) Space complexity: O(n)

    Returns string

Generated using TypeDoc