MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In linked list implementation of a queue, where does a new element be inserted?
A
At the head of link list
B
At the centre position in the link list
C
At the tail of the link list
D
None of the mentioned
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: -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.

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

There is 1 question to complete.