+1 vote
in Data Structures & Algorithms I by (110k points)
A normal queue, if implemented using an array of size MAX_SIZE, gets full when?

(a) Rear = MAX_SIZE – 1

(b) Front = (rear + 1)mod MAX_SIZE

(c) Front = rear + 1

(d) Rear = front

Question is taken from Queue Operations topic in division Abstract Data Types of Data Structures & Algorithms I

The question was posed to me in my homework.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
Correct answer is (a) Rear = MAX_SIZE – 1

Easy explanation - When Rear = MAX_SIZE – 1, there will be no space left for the elements to be added in queue. Thus queue becomes full.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...