title: make a linked list with head and tail nodes
body: <p>I am a newbie to data structure. When you make a linked list with head and tail nodes, why do I have to link new node to tail? Isn't it enough for tail.next to be linked to newNode?</p>
  
  <p>like this:</p>
  
  <pre><code>public void add( Object data ) {
  ListNode newNode = new ListNode( data );
      if ( isEmpty() ) {
          head = newNode;
      } else {
          tail.setNext( newNode );
      }
      tail = newNode;
      length = length + 1;
  }
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>if(head == null) {
      head = tail = newNode;
  } else {
      tail.next = newNode;
      tail = newNode;
  }
  </code></pre>
  
  <p>I looked up the basic of LinkedList but I still can't understand this so well. I am not sure how this lets head link to tail and how tail can keep previous value if you replace tail with newNode. Could you please explain this to me? Thank you so much!</p>