public class Node
{
public T Value { get; set; }
public Node Next { get; set; }
}
public static Node Reverse(Node head)
{
Node tail = null;
while(head!=null)
{
var node = new Node { Value = head.Value, Next = tail };
tail = node;
head = head.Next;
}
return tail;
}