title: Tracing through Linked List code
body: <p>Here is a linked list where pList points to the node containing the value 3</p>
  
  <pre><code>pList
    |
    3       7       6       1       2       8       4      5    -&gt;     NULL
  </code></pre>
  
  <p>Given the following code, redraw the list showing the changes to the list after the following code is executed.</p>
  
  <pre><code>pCur = pList;
  while(pCur-&gt;next-&gt;next != NULL)
     pCur = pCur-&gt;next;
  pCur-&gt;next-&gt;next = pList;
  pList = pCur -&gt; next;
  pCur -&gt; next = NULL;
  pCur = NULL;
  </code></pre>
  
  <p>Here is my interpretation of what is happening:
      pCur = pList (pCur = pList)
        |
        3       7       6       1       2       8       4      5    ->     NULL</p>
  
  <pre><code>pList    pCur  (pCur = pCur-&gt;next)
    |       |
    3       7       6       1       2       8       4      5    -&gt;     NULL
  
           pCur           PList (pCur-&gt;next-&gt;next = pList)
            |               |
    3       7       6       1       2       8       4      5    -&gt;     NULL
  
           pCur   pList       (pList = pCur-&gt;next)
            |       |
    3       7       6       1       2       8       4      5    -&gt;     NULL
  
  
                       (pCur-&gt;next = NULL)
    3       7       6       1       2       8    -&gt; NULL
  </code></pre>
  
  <p>I don't believe this is correct. What am I doing wrong?</p>