COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
4
|
|
0
|
|
1
|
|
None of these
|
Detailed explanation-1: -For insertions in the middle of the list four pointer assignments take place. But if the insertion is at the head or tail, then only two pointer assignments would be needed.
Detailed explanation-2: -Explanation: In a doubly linked list, an insertion operation would require updating three pointers: the next pointer of the previous node, the previous pointer of the new node, and the next pointer of the new node.
Detailed explanation-3: -In a doubly-linked list, each node contains two pointers, one forward to the next node and one back to the preceding node.
Detailed explanation-4: -There are generally three types of pointers required to implement a simple linked list: A ‘head’ pointer which is used for pointing to the start of the record in a list. A ‘tail’ pointer which is used for pointing to the last node. The key factor in the last node is that its subsequent pointer points to nothing (NULL).
Detailed explanation-5: -Answer: A) Explanation: 2 pointers are needed to be modified for insertion in the middle of a linked list, the node before the node to be inserted and the node which is being inserted.