MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A Queue uses a front and rear pointer?
A
True
B
False
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -It has two pointers, i.e., front and rear, where the insertion takes place from the front end, and deletion occurs from the front end. There are two operations that can be performed on a linear queue: o Enqueue: The enqueue operation inserts the new element from the rear end. front end of the queue.

Detailed explanation-2: -The front pointer stores the address of the first element of the queue, and the rear pointer stores the address of the last element of the queue. Insertion is performed at the rear end, whereas deletion is performed at the front end of the queue.

Detailed explanation-3: -In the linked queue, there are two pointers maintained in the memory i.e. front pointer and rear pointer. The front pointer contains the address of the starting element of the queue while the rear pointer contains the address of the last element of the queue.

Detailed explanation-4: -Queue is a non-primitive linear data structure that permits insertion of an element at one end and deletion of an element at the other end. The end at which the deletion of an element take place is called front, and the end at which insertion of a new element can take place is called rear.

Detailed explanation-5: -Initially the queue is empty and value of front and rear is both-1. When an element is inserted the value of rear will be incremented by 1 and the element would be inserted at the array index specified by the rear variable.

There is 1 question to complete.