MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
How many pointers are necessarily changed for the insertion in a Linked List?
A
One
B
Two
C
Three
D
Four
Explanation: 

Detailed explanation-1: -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. 6.

Detailed explanation-2: -In Singly linked list if we want to delete element from beginning then we require only 1 pointer variable of type node to hold the first element.

Detailed explanation-3: -As the doubly linked list contains two pointers i.e. previous and next, we can traverse it into the directions forward and backward.

Detailed explanation-4: -Two pointers are modified to insert X record.

Detailed explanation-5: -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.

There is 1 question to complete.