Computer Science · Data Structures
A linear queue is implemented using a fixed-size array of size 5 with indices 0-4. Initially, front = -1 and rear = -1. The following operations are performed: Enqueue(11), Enqueue(22), Enqueue(33), Dequeue(), Enqueue(44), Enqueue(55), Enqueue(66) Assume the Enqueue operation checks if rear == size-1 before inserting. If rear == size-1, it reports Overflow, even if empty slots were created due to deletions. What is the final status of the queue and pointers?
- 1Queue = [, 22, 33, 44, 55], front = 0, rear = 4; 66 causes Overflow
- 2Queue = [11, 22, 33, 44, 55], front = 0, rear = 4; 66 replaces 11
- 3Queue = [22, 33, 44, 55, 66], front = 0, rear = 4; no Overflow
- 4Queue = [, 22, 33, 44, 55], front = 1, rear = 4; Enqueue(66) causes Overflow✓
Correct answer
Queue = [, 22, 33, 44, 55], front = 1, rear = 4; Enqueue(66) causes Overflow
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Data Structures?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Data Structures