Method Insert
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
intThe zero-based index at which the node should be inserted.
value
TNodeValueThe value of the node label.
Returns
- Node<TNodeValue, TEdgeLabel>
The created node.
Exceptions
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
intThe 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.