public int this[int index] { set { int i = value; Node temp = new Node(i); if (start == null) { start = temp; temp = null; return; } if (start != null && index==0) { temp.NEXT = start; start = temp; temp = null; return; } else { int j = 1; Node p = start; while (p.NEXT != null) { if (j == index) { Node q = p.NEXT; p.NEXT = temp; temp.NEXT = q; temp = null; return; } p = p.NEXT; } p.NEXT = temp; temp.NEXT = null; temp = null; } } }
public Node(int d) { data = d; next = null; }
public Node() { data = 0; next = null; }
public LinkList() { start = null; }