Technically speaking wouldn't this be a way of deleting the last node? LL C++
<pre><code>node *head, *current, *temp;
current = head;
while(NULL != current){
  temp = current;
  current = current-&gt;next;
}
delete current;
current = temp;
current-&gt;next = NULL;
</code></pre>

<p>I'm just wondering I know there's something like this and there's recursion, assuming there's already a linked list and we don't know how many nodes are in the list.</p>

<p>By delete I mean deallocate.</p>

<pre><code>node *head, *current, *temp;
current = head;
while(NULL != current-&gt;next){
  temp = current;
  current = current-&gt;next;
}
if (NULL != current){
delete current;
current = temp;
current-&gt;next = NULL;
}
</code></pre>
