ProgrammingModerate

A doubly linked list stores prev pointers. How many pointer fields must change to insert a new node between two adjacent nodes A and B?

  1. A. 2
  2. B. 4
  3. C. 3
  4. D. 5

Correct answer: B. 4

new->prev and new->next are set, A->next and B->prev are redirected, so four pointers change.

More C Programming questions

Exams that ask this topic