title: Visual Explanation Guidance needed for reversal of Linked List datastructure code?
body: <p>I have following piece of code for reversing the linked list. I am getting confused in while loop and so would certainly appreciate if someone can provide visual explanation of how actually it's working. </p>
  
  <pre><code> static void Reverse (struct node** headRef)
  {
       struct node* result = NULL;
       struct node* current = *headref;
       struct node* next;
  
       while(current != NULL)
       {
          next = current-&gt;next;
          current-&gt;next = result;
          result = current;
  
          current = next;
       }     
       *headRef = result;
  
  }
  </code></pre>