4-Linked Lists/07. Linked List Problems_/JavaLinkedListDataStructures/JavaLinkedListDataStructures/LinkedList.java
public void addNode(T data) {
        if (head == null) {
            head = new Node<T>(data);
        } else {
            Node<T> curr = head;
            while (curr.getNext() != null) {
                curr = curr.getNext();
            }
            curr.setNext(new Node<T>(data));
        }
    }
/**
     * Append a new node to the end of the linked list.
     */
Append a new node to the end of the linked list.
Append a new node to the end of the linked list .
public void addNode(T data) {
        if (head == null) {
            head = new Node<T>(data);
        } else {
            Node<T> curr = head;
            while (curr.getNext() != null) {
                curr = curr.getNext();
            }
            curr.setNext(new Node<T>(data));
        }
    }
public void addNode ( T data ) { if ( head == null ) { head = new Node < T > ( data ) ; } else { Node < T > curr = head ; while ( curr . getNext ( ) != null ) { curr = curr . getNext ( ) ; } curr . setNext ( new Node < T > ( data ) ) ; } }
Append a new node to the end of the linked list.
Append a new node to the end of the linked list .