1. Data structures and algorithms must be drawing to think step by step, to achieve the following core code
Node prev = null;
while(head.next != null)
{
Node temp = head;
head->next = prev;
prev = head;
head = temp->next;
}
1. Data structures and algorithms must be drawing to think step by step, to achieve the following core code
Node prev = null;
while(head.next != null)
{
Node temp = head;
head->next = prev;
prev = head;
head = temp->next;
}