leetcode/src/main/java/com/my/MyLinkedList.java
/** Append a node of value val to the last element of the linked list. */
Append a node of value val to the last element of the linked list.
Append a node of value val to the last element of the linked list .
public void addAtTail(int val) {
        SingleNode node = new SingleNode(val);
        if(listIndex == 0){
            head = node;
        }else{
            tail.next = node;
        }
        tail = node;
        listIndex ++;
    }
public void addAtTail ( int val ) { SingleNode node = new SingleNode ( val ) ; if ( listIndex == 0 ) { head = node ; } else { tail . next = node ; } tail = node ; listIndex ++ ; }
Append a node of value val to the last element of the linked list.
Append a node of value val to the last element of the linked list .