title: How can I reverse a linked list?
body: <p>Consider:</p>
  <pre><code> Node reverse(Node head) {
      Node previous = null;
      Node current = head;
      Node forward;
  
      while (current != null) {
          forward = current.next;
          current.next = previous;
          previous = current;
          current = forward;
      }
  
      return previous;
  }
  </code></pre>
  <p>How exactly is it reversing the list?</p>
  <p>I get that it first sets the second node to <code>forward</code>. Then it says <code>current.next</code> is equal to a <code>null</code> node <code>previous</code>. Then it says <code>previous</code> is now <code>current</code>. Lastly <code>current</code> becomes <code>forward</code>?</p>
  <p>I can't seem to grasp this and how it's reversing. Can someone please explain how this works?</p>