public static void Main()
LinkedList list = new LinkedList();
Node Head = list.ReverseRecursive(list.head,null);
public static void PrintList(LinkedList list)
Node current = list.head;
Console.Write(current.data+"->");
Console.WriteLine("NULL");
Console.WriteLine("count of items in list are " + list.Count);
public void append(int data)
while(current.next!=null)
current.next = new Node(data);
public void prepend(int data)
Node newHead = new Node(data);
public void deleteWithValue(int data)
while(current.next !=null)
if(current.next.data == data)
current.next = current.next.next;
public Node ReverseListIterative ()
if(head == null || head.next == null)
public Node ReverseRecursive (Node current, Node prev)
Node next = current.next;
ReverseRecursive(next, current);