LinkedList<T>.AddAfter LinkedList<T>.AddAfter LinkedList<T>.AddAfter LinkedList<T>.AddAfter Method

Definition

Adds a new node or value after an existing node in the LinkedList<T>.

Overloads

AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>)

Adds the specified new node after the specified existing node in the LinkedList<T>.

AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T)

Adds a new node containing the specified value after the specified existing node in the LinkedList<T>.

AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>) AddAfter(LinkedListNode<T>, LinkedListNode<T>)

Adds the specified new node after the specified existing node in the LinkedList<T>.

public:
 void AddAfter(System::Collections::Generic::LinkedListNode<T> ^ node, System::Collections::Generic::LinkedListNode<T> ^ newNode);
public void AddAfter (System.Collections.Generic.LinkedListNode<T> node, System.Collections.Generic.LinkedListNode<T> newNode);
member this.AddAfter : System.Collections.Generic.LinkedListNode<'T> * System.Collections.Generic.LinkedListNode<'T> -> unit
Public Sub AddAfter (node As LinkedListNode(Of T), newNode As LinkedListNode(Of T))

Parameters

Exceptions

Examples

For an example that includes this method, see the LinkedList<T> class.

Remarks

LinkedList<T> accepts null as a valid Value for reference types and allows duplicate values.

This method is an O(1) operation.

See also

AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T) AddAfter(LinkedListNode<T>, T)

Adds a new node containing the specified value after the specified existing node in the LinkedList<T>.

public:
 System::Collections::Generic::LinkedListNode<T> ^ AddAfter(System::Collections::Generic::LinkedListNode<T> ^ node, T value);
public System.Collections.Generic.LinkedListNode<T> AddAfter (System.Collections.Generic.LinkedListNode<T> node, T value);
member this.AddAfter : System.Collections.Generic.LinkedListNode<'T> * 'T -> System.Collections.Generic.LinkedListNode<'T>
Public Function AddAfter (node As LinkedListNode(Of T), value As T) As LinkedListNode(Of T)

Parameters

value

The value to add to the LinkedList<T>.

Returns

Exceptions

Examples

For an example that includes this method, see the LinkedList<T> class.

Remarks

LinkedList<T> accepts null as a valid Value for reference types and allows duplicate values.

This method is an O(1) operation.

See also

Applies to