Options
All
  • Public
  • Public/Protected
  • All
Menu

Double-ended two-way linked list

Type parameters

  • T

    linked list node data

Hierarchy

  • default

Index

Constructors

  • new default<T>(iterable?: Iterable<T>): default<T>

Properties

firstNode: Nullable<default<T>> = null

A link to the first node of the list

lastNode: Nullable<default<T>> = null

A link to the last node of the list

lengthStore: number = 0

Internal length value of the list

Accessors

  • get length(): number

Methods

  • [iterator](): IterableIterator<T>
  • clear(): void
  • includes(data: T): boolean
  • push(...data: T[]): number
  • reverse(): IterableIterator<T>
  • Returns an iterator over the data in the list. The traversal will proceed from the last node to the first.

    Returns IterableIterator<T>

  • slice(start?: number, end?: number): default<T>
  • Returns a shallow copy of a portion of a list into a new LinkedList selected from start to end (end not included) where start and end represent the index of nodes in that list. The original list will not be modified.

    Parameters

    • Optional start: number
    • Optional end: number

    Returns default<T>

  • unshift(...data: T[]): number
  • Adds the passed data to the beginning of the list and returns its new length

    Parameters

    • Rest ...data: T[]

    Returns number

  • values(): IterableIterator<T>