title: Dequeueing in a LinkedList
body: <p>I'm trying to get my dequeue method working on my implementation of a LinkedList ADT. However, it is removing from the beginning of the queue instead of the end. Any help with this? I'm new to C, and am trying to port a java exercise over to C.. It's supposed to remove the last node of the list.</p>
  
  <p>Here's my dequeue method:</p>
  
  <pre><code>static void linkedQueueDequeue(Queue* q) {
      LinkedQueue *lq = ((LinkedQueue*)q-&gt;privateData);
      Node* temp = lq-&gt;head-&gt;next;
      lq-&gt;head-&gt;data = lq-&gt;head-&gt;next-&gt;data;
      lq-&gt;head-&gt;next = temp-&gt;next;
      free(temp);
      lq-&gt;size--;
  
  
  }
  </code></pre>
  
  <p>Here's the output when trying to dequeue last node:</p>
  
  <pre><code>=====================
  |Testing LinkedQueue|
  =====================
  adding 1 to first node
  adding 2 to second node
  adding 3 to third node
  adding 4 to fourth node
  [1,2,3,4]
  dequeue last node
  should print [1,2,3]
  [2,3,4]
  return first node
  peek: 2
  what's the size?
  size: 3
  </code></pre>