Question: Consider a doubly linked list and three nodes pointed by dnode* variables p, q, r. Assume the node pointed by q follows the one pointed

Consider a doubly linked list and three nodes pointed by dnode* variables p, q, r. Assume the node pointed by q follows the one pointed by p and preceeds the one pointed by r. Which of the following statements delete the node pointed by q from the doubly linked list ?

a.

p -> prev = q -> next; p -> next = q -> prev; delete q;

b.

p -> prev = q -> prev; r -> next = q -> next; delete q;

c.

p -> next = q -> prev; r -> prev = q -> next; delete q;

d.

r -> prev = q -> prev; p -> next = q -> next; delete q;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!