Question: Consider the following structure: struct Node { Node *prev; int key; Node *next; } Consider a pointer named head that points to the first node
Consider the following structure:
struct Node { Node *prev; int key; Node *next; }

Consider a pointer named head that points to the first node in the linked list, a pointer named tail that points to the last node, a pointer named temp that points to the node with value 7 and a node named newnode with the value 15.
After executing following code:
newnode->prev = temp;
temp->next->prev = newnode;
temp->next = newnode;
newnode->next = temp->next;
what will be the output if we print the linked list from tail to head?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
