public void AddToEnd(int data) { if (Next == null) { Next = new nodeClass(data); } else { Next.AddToEnd(data); } }
public void AddToEnd(int data) { if (headNode == null) { headNode = new nodeClass(data); } else { headNode.AddToEnd(data); } }
public void AddToBegginning(int data) { if (headNode == null) { headNode = new nodeClass(data); } else { nodeClass temp = new nodeClass(data); temp.Next = headNode; headNode = temp; } }
public void AddSorted(int data) { if (headNode == null) { headNode = new nodeClass(data); } else if (data < headNode.data) { AddToBegginning(data); } else { headNode.AddSorted(data); } }
public void AddSorted(int data) { if (Next == null) { Next = new nodeClass(data); } else if (data < Next.data) { nodeClass temp = new nodeClass(data); temp.Next = this.Next; this.Next = temp; } else { Next.AddSorted(data); } }
public myList() { headNode = null; }
public nodeClass(int i) { data = i; Next = null; Previous = null; }