MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In the linked list implementation of queue, where will the new element be inserted?
A
At the middle position of the linked list
B
At the head position of the linked list
C
At the tail position of the linked list
D
None of the above
Explanation: 

Detailed explanation-1: -In a linked list implementation of a queue, insertion always occurs at the rear end of the tail. While implementing a queue, the new element would also get inserted at the end.

Detailed explanation-2: -The insertion in a linked queue is performed at the rear end by updating the address value of the previous node where a rear pointer is pointing.

Detailed explanation-3: -Queue is an abstract data type or a linear data structure, in which the first element is inserted from one end called the rear, and the removal of existing element takes place from the other end called as front.

Detailed explanation-4: -Correct answer is C In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.

There is 1 question to complete.