public void addToEnd(int data) { if (next == null) { next = new SingleLinkNode(data); } else { next.addToEnd(data); } }
public void AddToEnd(int data) { if (headNode == null) { headNode = new SingleLinkNode(data); } else { headNode.addToEnd(data); } }