Table of Contents

Method Insert

Namespace
Bonsai.Dag
Assembly
Bonsai.Core.dll

Insert(int, TNodeValue)

Creates and inserts a new node with the specified value into the directed graph at the specified index.

public Node<TNodeValue, TEdgeLabel> Insert(int index, TNodeValue value)

Parameters

index int

The zero-based index at which the node should be inserted.

value TNodeValue

The value of the node label.

Returns

Node<TNodeValue, TEdgeLabel>

The created node.

Exceptions

ArgumentOutOfRangeException

Insert(int, Node<TNodeValue, TEdgeLabel>)

Inserts a node into the directed graph at the specified index.

public void Insert(int index, Node<TNodeValue, TEdgeLabel> node)

Parameters

index int

The zero-based index at which the node should be inserted.

node Node<TNodeValue, TEdgeLabel>

The node to insert into the directed graph.

Remarks

If the node is already in the directed graph, it will be moved into the new index position. Any successor nodes which are not in the graph will also be added in depth-first order.

Exceptions

ArgumentNullException
ArgumentOutOfRangeException