public void addAtEnd(int item) { Node nn = new Node(item); //Attach new node to the previous node if(this.size >= 1) this.tail.next = nn; //Shift tail at the end node else head = nn; tail = nn; size++; }
public void addAtEnd(int item) { Node nn = new Node(item); //Attach new node to the previous node if(this.size >= 1) this.tail.next = nn; //Shift tail at the end node else head = nn; tail = nn; size++; }