MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If front=rear, then the queue is?
A
full
B
undeflow
C
overflow
D
empty
Explanation: 

Detailed explanation-1: -Queue is said to be empty when the value of front is at-1 or the value of front becomes greater than rear (front > rear).

Detailed explanation-2: -queue::empty() is used to check whether the associated queue container is empty or not. This function returns either true or false, if the queue is empty (size is 0) then the function returns true, else if the queue is having some value then it will return false.

Detailed explanation-3: -In an empty queue, rear and front can be initial to-1. and the rear node of the queue, respectively.

Detailed explanation-4: -1. If the queue is empty, then the front and rear are set to 0 to insert a new element. 2. If queue is not empty, then the value of the rear gets incremented.

Detailed explanation-5: -A queue is structured as an ordered collection of items which are added at one end, called the “rear, ” and removed from the other end, called the “front.” The queue operations are: Queue() creates a new queue that is empty.

There is 1 question to complete.