using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Node { private T info; private Node NextNode; public Node(T info) { this.info = info; this.NextNode = null; } public Node(T info, Node NextNode) { this.info = info; this.NextNode = NextNode; } public Node GetNextNode() { return this.NextNode; } public T GetInfo() { return this.info; } public void SetNextNode(Node NextNode) { this.NextNode = NextNode; } public void SetInfo(T info) { this.info = info; } public override string ToString() { return "info= " + this.info; } } class PrintAll { public static void Print(Node Node) { while (Node != null) { Console.WriteLine(Node.ToString()); Node = Node.GetNextNode(); } } } }