Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a doubly-Linked circular list.

summary

In this type of linked list, the next of the last node will point to the first node and the previous pointer of the first node will point to the last node.

since

1.1.19

version

2019-03-22

Type parameters

  • T

Hierarchy

  • KavenLinkedList

Implements

Index

Constructors

constructor

  • Type parameters

    • T

    Returns KavenLinkedList<T>

Properties

Optional EqualityComparer

EqualityComparer: TEqualityComparer<T>

Protected count

count: number

Protected Optional head

Accessors

Count

  • get Count(): number
  • Gets the number of nodes actually contained in the KavenLinkedList.

    Returns number

First

Last

Methods

AddAfter

  • Adds a new node containing the specified value after the specified existing node in the KavenLinkedList.

    Parameters

    Returns KavenLinkedListNode<T>

    The new KavenLinkedListNode containing value.

AddBefore

  • Adds a new node containing the specified value before the specified existing node in the KavenLinkedList.

    Parameters

    Returns KavenLinkedListNode<T>

    The new KavenLinkedListNode containing value.

AddFirst

  • Adds a new node containing the specified value at the start of the KavenLinkedList.

    Parameters

    • value: T

    Returns KavenLinkedListNode<T>

    The new KavenLinkedListNode containing value.

AddLast

  • Adds a new node containing the specified value at the end of the KavenLinkedList.

    Parameters

    • value: T

    Returns KavenLinkedListNode<T>

    The new KavenLinkedListNode containing value.

Clear

  • Clear(): void
  • Removes all nodes from the KavenLinkedList.

    Returns void

Contains

  • Contains(value: T): boolean
  • Determines whether a value is in the KavenLinkedList.

    Parameters

    • value: T

    Returns boolean

    true if value is found in the KavenLinkedList; otherwise, false.

Find

  • Finds the first node that contains the specified value.

    Parameters

    • value: T

    Returns undefined | KavenLinkedListNode<T>

    The first KavenLinkedListNode that contains the specified value, if found; otherwise, undefined.

FindLast

  • Finds the last node that contains the specified value.

    Parameters

    • value: T

    Returns undefined | KavenLinkedListNode<T>

    The last KavenLinkedListNode that contains the specified value, if found; otherwise, undefined.

Random

  • Random(): undefined | T
  • Returns undefined | T

Remove

  • Remove(value: T): boolean
  • Removes the first occurrence of the specified value from the KavenLinkedList.

    Parameters

    • value: T

    Returns boolean

    true if the element containing value is successfully removed; otherwise, false. This method also returns false if value was not found in the original KavenLinkedList.

RemoveFirst

  • RemoveFirst(): void
  • Removes the node at the start of the KavenLinkedList.

    Returns void

RemoveLast

  • RemoveLast(): void
  • Removes the node at the end of the KavenLinkedList.

    Returns void

Protected insertNodeBefore

Protected insertNodeToEmptyList

  • Parameters

    Returns void

Protected isEqual

  • isEqual(a: T, b: T): boolean
  • Parameters

    • a: T
    • b: T

    Returns boolean

Protected removeNode

  • Parameters

    Returns void

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Class
  • Class with type parameter
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Protected property
  • Protected method
  • Enumeration

Generated using TypeDoc