using System.Collections.Generic;
using System.Threading.Tasks;
public void Add(Node node)
while(cursor.NextNode != null)
cursor = cursor.NextNode;
public void Inserte(Node nodein, Node node)
temp.Value= nodein.Value;
temp.NextNode=node.NextNode;
public void Remove(Node node)
Node prevNode = FindPrevNode(node);
prevNode.NextNode = node.NextNode;
public Node FindPrevNode(Node node)
if (node == Head) return null;
while(cursor.NextNode != node && cursor.HasNext())
cursor = cursor.NextNode;
throw new Exception("Can't find element with value " + node.Value);
Console.Write(cursor.Value + " ");
cursor = cursor.NextNode;
public static void Main()
Node myNode = new Node(2);
Node myNodeIn=new Node(56);
List list1 = new List(5);
list1.Inserte(myNodeIn,myNode);