while (pList)
{
Node *temp = pList->next;
delete pList;
pList = temp;
}
First iteration:
temp = pList->next;
![]()
delete pList;
![]()
pList = temp;
![]()
Second iteration:
temp = pList->next;
![]()
delete pList;
![]()
pList = temp;
![]()
Third iteration:
temp = pList->next;
![]()
delete pList;
![]()
pList = temp;
![]()
End of while loop.