public static void Main()
List<int> ls=new List<int>();
Console.WriteLine("Hello World");
private Node<T> GetNd(int stps)
for(int i=0; i<stps && pos!=null ;i++)
return GetNd(i).GetValue();
return this.last.GetValue();
public void SetVal(int i,T val)
public void Insert(T val)
this.first=new Node<T>(val);
this.last = new Node<T>(val);
this.last.SetNext(new Node<T>(val));
this.last=this.last.GetNext();
public void Insert(int i,T val)
Node<T> tmp=pos.GetNext();
pos.SetNext(new Node<T>(val));
pos.GetNext().SetNext(tmp);
public override string ToString()
return Helper(this.first,0);
private string Helper(Node<T> pos,int cnt)
return pos.ToString()+Helper(pos.GetNext(),cnt++);
public Node (T value, Node<T> next)
public void SetValue (T value)
public void SetNext(Node<T> next)
return this.next != null;
public override String ToString()
return this.value.ToString();