How many pointers must be changed to insert a new node between two existing nodes of a doubly linked list?
Correct answer A. 4
Explanation
The new node needs its prev and next set to its neighbours (two changes), and the neighbours must point to it: the left node's next and the right node's prev (two more). That makes four pointer assignments. In a singly linked list the same insertion takes only two, since nodes have no backward link to maintain.
Answer checked How we write and check questions
Discussion