LinkedList<T>.AddBefore LinkedList<T>.AddBefore LinkedList<T>.AddBefore LinkedList<T>.AddBefore Method

Definition

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

Overloads

AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>)

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

AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T)

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

AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>) AddBefore(LinkedListNode<T>, LinkedListNode<T>)

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

public:
 void AddBefore(System::Collections::Generic::LinkedListNode<T> ^ node, System::Collections::Generic::LinkedListNode<T> ^ newNode);
public void AddBefore (System.Collections.Generic.LinkedListNode<T> node, System.Collections.Generic.LinkedListNode<T> newNode);
member this.AddBefore : System.Collections.Generic.LinkedListNode<'T> * System.Collections.Generic.LinkedListNode<'T> -> unit
Public Sub AddBefore (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

AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T) AddBefore(LinkedListNode<T>, T)

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

public:
 System::Collections::Generic::LinkedListNode<T> ^ AddBefore(System::Collections::Generic::LinkedListNode<T> ^ node, T value);
public System.Collections.Generic.LinkedListNode<T> AddBefore (System.Collections.Generic.LinkedListNode<T> node, T value);
member this.AddBefore : System.Collections.Generic.LinkedListNode<'T> * 'T -> System.Collections.Generic.LinkedListNode<'T>
Public Function AddBefore (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