← Interactive API Explorer
Namespace: System.Collections.Generic

LinkedList<T>

Represents a high-performance doubly linked list backed by a contiguous, growable Slot array with per-slot generation counters for safe handle tracking without dangling-pointer undefined behavior.

Properties (3)

int Count
Gets the number of nodes actually contained in the LinkedList.
Value: The number of nodes actually contained in the LinkedList.
LinkedListNode<T> First
Gets the first node of the LinkedList.
Value: The first LinkedListNode of the LinkedList.
LinkedListNode<T> Last
Gets the last node of the LinkedList.
Value: The last LinkedListNode of the LinkedList.

Methods (5)

LinkedListNode<T> AddFirst(T)
Adds a new node containing the specified value at the start of the LinkedList.
ParameterDescription
valueThe value to add at the start of the LinkedList.
Returns: The new LinkedListNode containing value.
void AddAfter(LinkedListNode<T>,T)
Adds a new node containing the specified value after the specified existing node in the LinkedList.
ParameterDescription
nodeThe LinkedListNode after which to insert a new LinkedListNode containing value.
valueThe value to add to the LinkedList.
Returns: The new LinkedListNode containing value.
bool Remove(LinkedListNode<T>)
Removes the specified node from the LinkedList.
ParameterDescription
nodeThe LinkedListNode to remove from the LinkedList.
void Clear
Removes all nodes from the LinkedList.
Enumerator<T> GetEnumerator
Returns an enumerator that iterates through the LinkedList.
Returns: An Enumerator for the LinkedList.