Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : Full with 5 elements, since (rear+1) mod 5 equals front / 5 अवयवों सहित पूर्ण, क्योंकि (rear+1) mod 5 = front

Advertisement

Detailed Solution

सही उत्तर Full with 5 elements, since (rear+1) mod 5 equals front / 5 अवयवों सहित पूर्ण, क्योंकि (rear+1) mod 5 = front है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

A circular queue of capacity 5 has front = 0 and rear = 3 (holding 4 elements). After one dequeue followed by two enqueues, the queue is / क्षमता 5 वाली वृत्तीय कतार में front = 0 और rear = 3 है (4 अवयव हैं)। एक dequeue के बाद दो enqueue करने पर कतार होगी

1.
Holding only 3 elements / केवल 3 अवयव रखेगी
2.
In an overflow state with data loss / डेटा-हानि सहित अतिप्रवाह अवस्था में
3.
In an underflow state / अधोप्रवाह अवस्था में
4.
Full with 5 elements, since (rear+1) mod 5 equals front / 5 अवयवों सहित पूर्ण, क्योंकि (rear+1) mod 5 = front

Correct Answer: Full with 5 elements, since (rear+1) mod 5 equals front / 5 अवयवों सहित पूर्ण, क्योंकि (rear+1) mod 5 = front

After the dequeue front becomes 1 (3 elements); two enqueues move rear to 4 then wrap to 0 (5 elements). Now (0+1) mod 5 = 1 = front, the standard full condition. / Dequeue के बाद front = 1 (3 अवयव); दो enqueue से rear 4 फिर लिपटकर 0 (5 अवयव)। अब (0+1) mod 5 = 1 = front, जो मानक पूर्ण-शर्त है।

Downloaded from PrepSnap (prepsnap.in)