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.
| Parameter | Description |
|---|---|
| value | The 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.
| Parameter | Description |
|---|---|
| node | The LinkedListNode after which to insert a new LinkedListNode containing value. |
| value | The value to add to the LinkedList. |
Returns: The new LinkedListNode containing value.
bool Remove(LinkedListNode<T>)
Removes the specified node from the LinkedList.
| Parameter | Description |
|---|---|
| node | The 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.