Question: Consider the following function, which accepts as a parameter a reference to the head of a Doubly Linked List. Assume a doubly Linked List

Consider the following function, which accepts as a parameter a reference to the head of a Doubly Linked List. Assume a doubly Linked List node contains a prior pointer of p and the next pointer of n. void funct(node head) { node t = NULL; node c = head; while (c!= NULL) { t = c.p; c.p = c.n; c.n = t; c = c.p; } } if(t != NULL) head = t.p; Assume that reference of head of following doubly linked list is passed to above function 7 8 9 10 11 12. What should be the modified linked list after the function call?
Step by Step Solution
There are 3 Steps involved in it
Answer Lets analyze the function funct step by step It initializes two pointers t and c t to ... View full answer
Get step-by-step solutions from verified subject matter experts
