Class implements bidirectional non-circular linked list.
LinkedListElement - object of any type that has properties next and prev.

Hierarchy (view full)

Constructors

Properties

first: undefined | LinkedListElement
last: undefined | LinkedListElement

Accessors

  • get size(): number
  • Return the number of elements in the list

    Returns number

    number of elements in the list

Methods

  • Return true if the list is empty

    Returns boolean

  • Reverse the linked list

    Returns LinkedList

  • Return an array of elements from start to end If start or end is not defined, take the first as the start, the last as the end

    Parameters

    Returns LinkedListElement[]

    Array containing elements

  • Throw an error if a circular loop is detected in the linked list

    Parameters

    Returns void