Class ObjectDeque<E>

Type Parameters

  • E = number

Hierarchy

  • ObjectDeque

Constructors

Properties

_capacity: number = Number.MAX_SAFE_INTEGER
_first: number = -1
_last: number = -1
_nodes: {
    [key: number]: E;
} = {}

Type declaration

  • [key: number]: E
_size: number = 0

Accessors

Methods

  • The "addFirst" function adds a value to the beginning of an array-like data structure.

    Parameters

    • value: E

      The value parameter represents the value that you want to add to the beginning of the data structure.

    Returns void

  • The addLast function adds a value to the end of an array-like data structure.

    Parameters

    • value: E

      The value parameter represents the value that you want to add to the end of the data structure.

    Returns void

  • The get function returns the element at the specified index in an array-like data structure.

    Parameters

    • index: number

      The index parameter is a number that represents the position of the element you want to retrieve from the array.

    Returns null | NonNullable<E>

    The element at the specified index in the _nodes array is being returned. If there is no element at that index, null is returned.

  • The function checks if the size of a data structure is less than or equal to zero.

    Returns boolean

    The method is returning a boolean value indicating whether the size of the object is less than or equal to 0.

  • The peekFirst function returns the first element in an array-like data structure if it exists.

    Returns undefined | E

    The element at the first position of the _nodes array.

  • The peekLast() function returns the last element in an array-like data structure.

    Returns undefined | E

    The last element in the array "_nodes" is being returned.

  • The function pollFirst() removes and returns the first element in a data structure.

    Returns undefined | E

    The value of the first element in the data structure.

  • The pollLast() function removes and returns the last element in a data structure.

    Returns undefined | E

    The value that was removed from the data structure.

Generated using TypeDoc