Quiz Q-09:
Predict the modified doubly linked list of the following code for the given doubly linked list as 1<–> 2 <–> 3 <–> 4 <–> 5 <–>6
CPP
void fun(node **head_ref)
{
node *temp = NULL;
node *current = *head_ref;
while (current != NULL)
{
temp = current->prev;
current->prev = current->next;
current->next = temp;
current = current->prev;
}
if(temp != NULL )
*head_ref = temp->prev;
}