Q. Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

  • (A) full: (rear+1) mod n == front, empty: rear == front
  • (B) full: (rear+1) mod n == front, empty: (front+1) mod n == rear
  • (C) full: rear == front, empty: (rear+1) mod n == front
  • (D) full: (front+1) mod n == rear, empty: rear == front
πŸ’¬ Discuss
βœ… Correct Answer: (A) full: (rear+1) mod n == front, empty: rear == front

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
1061
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate