ISRO Scientist/Engineer CSE 2017Data Structures › Linked Lists
ISRO Scientist/Engineer CSE 2017 PYQ: In a doubly linked list the number of pointers affected for an insertion operation will be
In a doubly linked list the number of pointers affected for an insertion operation will be
- A4Correct answer
- B0
- C1
- DDepends on the nodes of doubly linked list
Answer
(A) 4
Approach
In a doubly linked list, inserting a node generally requires updating four pointers: the new node's next and prev, plus the next pointer of the previous node and the prev pointer of the next node (or head/tail pointers in special cases). Standard exam convention counts these four affected pointers regardless of insertion at beginning or middle. The option 'Depends on the nodes' is a distractor and not the intended answer.
Reviewed by ISRO IQ Editorial Team.