using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
Node head2=InitLL("int");
Node rev=ReverseLL(head);
public static void PrintLL(Node head)
Console.WriteLine(head.value.ToString());
public static void PrintLLRec(Node head)
Console.WriteLine(head.value.ToString());
public static Node ZapList(Node head1,Node head2)
while(curr1!=null && curr2!=null)
public static Node ReverseLL(Node head)
public static Node ReverseLLRec(Node head,Node prev)
if(head==null) return prev;
return ReverseLLRec(next,head);
public static bool FindInLL(Node head,int val)
if(head.value==val) return true;
public static bool FindInLLRec(Node head,int val)
if(head==null) return false;
if(head.value==val) return true;
return FindInLLRec(head.next,val);
public static int GetNodeVal(Node head,int indx)
public static int GetNodeValRec(Node head,int indx)
if(indx==0) return head.value;
if(head==null) return Int32.MinValue;
return GetNodeValRec(head.next,indx-1);
public static int SumList(Node head)
public static int SumListRec(Node head)
return head.value+SumListRec(head.next);
public static List<int> ReturnElements(Node head)
List<int> output=new List<int>();
public static List<int> ReturnElementsRec(Node head)
if(head==null) return null;
List<int> output=new List<int>();
List<int> temp=ReturnElementsRec(head.next);
public static void PrintList(List<int> input)
Console.WriteLine(i.ToString());
public static Node InitLL(string dt)
Node head=new Node(Int32.MinValue);