Which of the following determines the need for the circular queue?
2023
Which of the following determines the need for the circular queue?
- A.
Access the queue using priority
- B.
Avoid wastage of memory
- C.
Follow the FIFO principles
- D.
More than one of the above
- E.
None of the above
Attempted by 582 students.
Show answer & explanation
Correct answer: B
A circular queue is used to efficiently manage memory by reusing the space after the rear pointer. In a standard linear queue, once the rear reaches the end, no more elements can be added even if there is free space at the front. This leads to memory wastage. In a circular queue, the rear wraps around to the beginning when it reaches the end, allowing the queue to reuse the empty spaces at the front. This prevents memory wastage and improves space utilization.
हिन्दी उत्तर: एक सर्कुलर क्यू का उपयोग स्मृति का कुशल उपयोग करने के लिए किया जाता है। एक मानक रेखीय क्यू में, जब रियर पॉइंटर अंत तक पहुँच जाता है, तो फिर भी अगर शुरुआत में खाली जगह हो तो अधिक तत्व जोड़े नहीं जा सकते। इससे स्मृति की बर्बादी होती है। एक सर्कुलर क्यू में, जब रियर अंत तक पहुँच जाता है, तो वह शुरुआत में वापस आ जाता है, जिससे शुरुआत में खाली जगह का पुन: उपयोग किया जा सकता है। इससे स्मृति की बर्बादी से बचा जा सकता है और स्थान का उपयोग बेहतर होता है।