rendered paste bodyusing System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Node<T>
{
private T info;
private Node<T> NextNode;
public Node(T info)
{
this.info = info;
this.NextNode = null;
}
public Node(T info, Node<T> NextNode)
{
this.info = info;
this.NextNode = NextNode;
}
public Node<T> GetNextNode()
{
return this.NextNode;
}
public T GetInfo()
{
return this.info;
}
public void SetNextNode(Node<T> 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<T>(Node<T> Node)
{
while (Node != null)
{
Console.WriteLine(Node.ToString());
Node = Node.GetNextNode();
}
}
}
}