while(head) //repeat until empty.
{
tmp = head->next. //save the rest of the list. this may be null, and that is OK, its the end of the loop/list
delete head. //destroy the top node.
head = tmp; //the list is now the same as before minus the top node. this may also be null/empty list, the while will catch that.
}