MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
____ the condition indicate the queue is empty.
A
Front=Null
B
Null=Front
C
Front=Rear
D
Rear=Null
Explanation: 

Detailed explanation-1: -The condition FRONT=NULL indicates that queue is empty. Whenever an element is deleted from the queue, the value of FRONT is increased by 1. Similarly, whenever an element is added to queue, the value of REAR is increased by 1.

Detailed explanation-2: -If front and rear both are NULL, it indicates that the queue is empty.

Detailed explanation-3: -In circular queues, the statement rear=front indicates that the queue is empty and for a full queue we have : rear=n-1, front=0, rear+1=front=0=n.

Detailed explanation-4: -Queue is completely full when rear is at last array position i.e. (MaxSize-1). Now no more elements can be inserted in queue even if the queue has some empty spaces.

Detailed explanation-5: -Explanation: The answer is b, i.e., Underflow. Before deleting an element from the Queue, we first need to check whether the Queue is empty or not.

There is 1 question to complete.