Circular Queue: Modulo Arithmetic Implementation (rear+1)%size Notes in Hindi & English : सर्कुलर कतार: मॉड्यूलो अंकगणित कार्यान्वयन और खाली/पूर्ण शर्तें और 20 महत्वपूर्ण MCQ प्रश्न (Rajasthan IT Exam)

Post a Comment

PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Circular Queue: Modulo Arithmetic Implementation (rear+1)%size (सर्कुलर कतार: मॉड्यूलो अंकगणित कार्यान्वयन और खाली/पूर्ण शर्तें) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।

Overview: A Circular Queue treats a linear array of size N as a closed logical ring using modulo arithmetic—advancing pointers with (rear + 1) % N and (front + 1) % N—to reuse vacated slots in O(1) time. Two canonical conventions distinguish Empty from Full states: either initializing front = rear = -1 (holding all N items) or reserving one sentinel slot (holding N - 1 items).

अध्याय सार: सर्कुलर कतार (Circular Queue) N आकार के एरे को मॉड्यूलो अंकगणित (rear + 1) % N व (front + 1) % N द्वारा एक गोल रिंग के रूप में उपयोग करती है, जिससे खाली स्लॉट O(1) समय में पुनः उपयोग हो जाते हैं। इसमें खाली व पूर्ण अवस्था पहचानने हेतु या तो -1 सेंटिनल (क्षमता N) या एक खाली स्लॉट रिजर्व करने (क्षमता N - 1) की विधि अपनाई जाती है।

Circular Queue: Modulo Arithmetic Implementation (rear+1)%size: Detailed Notes & Architecture (सर्कुलर कतार: मॉड्यूलो अंकगणित कार्यान्वयन और खाली/पूर्ण शर्तें)

1. Modulo Wrap-Around Arithmetic (rear + 1) % size (मॉड्यूलो रैप-अराउंड अंकगणित (rear + 1) % size)

[EN] When rear sits at the physical end of the array (index size - 1), adding 1 modulo size yields (size - 1 + 1) % size == 0, wrapping smoothly back to index 0 if vacant. Likewise, dequeue advances front using (front + 1) % size instead of simple front++. This eliminates the right-drift and false overflow of linear queues while preserving contiguous cache-friendly array memory and strict O(1) pointer updates.

[HI] जब rear एरे के अंतिम इंडेक्स (size - 1) पर होता है, तब (rear + 1) % size का मान 0 हो जाता है और पॉइंटर घूमकर पुनः इंडेक्स 0 पर आ जाता है। इसी तरह डिकतार पर front को (front + 1) % size से आगे बढ़ाया जाता है। यह तकनीक मेमोरी की बर्बादी को पूरी तरह समाप्त करके O(1) गति बनाए रखती है।

2. Empty and Full Conditions: Sentinel -1 vs 1-Slot-Reserved (खाली व पूर्ण शर्तें: -1 सेंटिनल बनाम 1-स्लॉट आरक्षित विधि)

[EN] Because wrapping causes rear to approach right behind front when full, distinguishing Empty from Full requires an explicit design choice. Under the popular C sentinel convention (front = -1, rear = -1 initially), Empty is `front == -1` and Full is `(rear + 1) % size == front`, storing all `size` items. Under the 1-slot-sacrificed ring convention (front = rear = 0 initially), Empty is `front == rear` and Full is `(rear + 1) % size == front`, reducing usable capacity to `size - 1`. Alternatively, keeping an integer `count` makes Empty `count == 0` and Full `count == size`.

[HI] रिंग में घूमने के बाद पूर्ण अवस्था में भी rear, front के ठीक पीछे आ सकता है, इसलिए Empty और Full में अंतर स्पष्ट करना आवश्यक है। मानक -1 सेंटिनल विधि में Empty की शर्त `front == -1` और Full की शर्त `(rear + 1) % size == front` होती है तथा पूरे `size` तत्व आते हैं। वहीं, बिना -1 वाली `front == rear` (Empty) विधि में दोनों अवस्थाओं को अलग रखने हेतु 1 स्लॉट खाली छोड़ा जाता है, जिससे अधिकतम क्षमता `size - 1` रह जाती है।

3. Circular Enqueue, Dequeue, and Single-Element Reset (सर्कुलर एनकतार, डिकतार और अंतिम तत्व रीसेट)

[EN] In the sentinel (-1) implementation, enqueue first checks if `(rear + 1) % size == front` (Overflow); if empty (`front == -1`), it sets `front = 0; rear = 0;` else `rear = (rear + 1) % size;`, then writes `arr[rear] = x`. On dequeue, after verifying `front != -1`, it saves `arr[front]`: if `front == rear` (one item left), both pointers reset to `-1`; otherwise `front = (front + 1) % size`.

[HI] सेंटिनल (-1) कार्यान्वयन में enqueue पहले `(rear + 1) % size == front` से Overflow जांचता है; खाली होने पर दोनों को 0 करता है, अन्यथा `rear = (rear + 1) % size` पर मान रखता है। dequeue में अंतिम तत्व (`front == rear`) हटने पर दोनों को -1 पर रीसेट किया जाता है, वरना `front = (front + 1) % size` से आगे बढ़ाते हैं।

4. Element Count Formula and Real-World Ring Buffers (तत्व गिनती सूत्र और वास्तविक रिंग बफर अनुप्रयोग)

[EN] Even after rear wraps numerically behind front (so rear < front), active item count is computed cleanly in O(1) as `(rear - front + size) % size + 1` (for non-empty sentinel -1 queues), or `(rear - front + size) % size` for 1-slot-reserved queues. Circular queues power OS Round-Robin CPU time-slice scheduling, audio/video streaming ring buffers, and network card DMA descriptor rings.

[HI] रैप-अराउंड के बाद rear < front हो जाने पर भी सक्रिय तत्वों की संख्या `(rear - front + size) % size + 1` (-1 विधि में) या `(rear - front + size) % size` (1-स्लॉट विधि में) से तुरंत निकल आती है। सर्कुलर कतार का प्रयोग Round-Robin CPU शेड्यूलिंग, ऑडियो-वीडियो स्ट्रीमिंग और नेटवर्क NIC रिंग बफर में होता है।

Syntax, Formula & Technical Example (Circular Queue: Modulo Arithmetic Implementation (rear+1)%size)

#define SIZE 5
int cq[SIZE], front = -1, rear = -1;
int isFull()  { return (rear + 1) % SIZE == front; }
int isEmpty() { return front == -1; }
void cqEnqueue(int x) {
    if (isFull()) return; // Overflow
    if (front == -1) front = rear = 0;
    else rear = (rear + 1) % SIZE;
    cq[rear] = x;
}
int cqDequeue() {
    if (isEmpty()) return -1; // Underflow
    int val = cq[front];
    if (front == rear) front = rear = -1;
    else front = (front + 1) % SIZE;
    return val;
}

Circular Queue: Modulo Arithmetic Implementation (rear+1)%size Quick Reference & Comparison Table

Circular Queue RuleMathematical FormulaKey Exam Fact
Next Rear Wrap-Aroundrear = (rear + 1) % sizeWraps index size - 1 back to 0
Full Check (Sentinel -1)(rear + 1) % size == frontHandles both normal & wrapped full states
Empty Check (Sentinel -1)front == -1Allows storing all `size` elements
1-Slot-Sacrificed Capacitysize - 1 maximum usable slotsRequired when front == rear marks Empty

Circular Queue: Modulo Arithmetic Implementation (rear+1)%size Top 20 Bilingual MCQs with Answers

Q1. Which expression correctly advances the rear pointer in a Circular Queue of capacity N?

(N क्षमता वाली सर्कुलर कतार में rear पॉइंटर को आगे बढ़ाने का सही सूत्र क्या है?)

(A) rear = rear % (N + 1)

(B) rear = (rear + 1) % N

(C) rear = (rear - 1) % N

(D) rear = (rear + 1) / N

Correct Answer: (B)

[EN] Adding 1 modulo N wraps rear from index N - 1 directly back to index 0.

[HI] (rear + 1) % N सूत्र N - 1 के बाद rear को स्वतः घूमकर इंडेक्स 0 पर ले आता है।

Q2. In a Circular Queue using front = -1, rear = -1 initially, what condition accurately tests Queue Full?

(front = -1, rear = -1 से शुरू होने वाली सर्कुलर कतार में कतार पूर्ण (Full) होने की सही शर्त कौन सी है?)

(A) (rear + 1) % MAX == front

(B) rear == MAX - 1

(C) (front + 1) % MAX == rear

(D) front == rear

Correct Answer: (A)

[EN] Whether un-wrapped (front=0, rear=MAX-1) or wrapped (rear one step behind front), (rear + 1) % MAX == front detects fullness.

[HI] सामान्य और रैप-अराउंड दोनों स्थितियों में (rear + 1) % MAX == front सही ढंग से कतार के भरने की जांच करता है।

Q3. In a Circular Queue of size N that defines Empty as `front == rear` and Full as `(rear + 1) % N == front` (without -1 or count), how many elements can it hold at most?

(यदि कोई सर्कुलर कतार बिना -1 या count के `front == rear` को Empty और `(rear + 1) % N == front` को Full मानती है, तो उसमें अधिकतम कितने तत्व आ सकते हैं?)

(A) N elements

(B) N + 1 elements

(C) N / 2 elements

(D) N - 1 elements

Correct Answer: (D)

[EN] One slot must remain permanently vacant so that the Full condition does not collide with the Empty condition (front == rear).

[HI] Empty और Full शर्तों के आपसी टकराव से बचने के लिए 1 स्लॉट खाली छोड़ना पड़ता है, अतः अधिकतम N - 1 तत्व ही आते हैं।

Q4. Given a Circular Queue of size 6 (sentinel -1 design) with front = 3 and rear = 1, how many elements are currently in the queue?

(साइज 6 की सर्कुलर कतार (-1 सेंटिनल विधि) में यदि front = 3 और rear = 1 है, तो कतार में कितने तत्व मौजूद हैं?)

(A) 4

(B) 5

(C) 2

(D) 3

Correct Answer: (B)

[EN] Elements sit at indices 3, 4, 5, 0, 1: count = (1 - 3 + 6) % 6 + 1 = 4 + 1 = 5.

[HI] तत्व इंडेक्स 3, 4, 5, 0, 1 पर हैं; सूत्र (rear - front + size) % size + 1 = (1 - 3 + 6) % 6 + 1 = 5 तत्व।

Q5. Trace a Circular Queue of size 5 (sentinel -1): front = 2, rear = 4. After inserting ONE item, what is the new value of rear?

(साइज 5 की सर्कुलर कतार में front = 2 और rear = 4 है। एक नया तत्व डालने पर rear का नया मान क्या होगा?)

(A) Overflow

(B) 1

(C) 5

(D) 0

Correct Answer: (D)

[EN] (4 + 1) % 5 = 0; since 0 != front (2), insertion succeeds at index 0.

[HI] (4 + 1) % 5 = 0 होगा और चूंकि यह front (2) के बराबर नहीं है, नया तत्व इंडेक्स 0 पर जुड़ जाएगा।

Q6. Continuing from size 5, front = 2, rear = 0: if we insert ONE more item (rear -> 1), what happens on the NEXT insertion attempt?

(साइज 5, front = 2, rear = 0 से एक तत्व और जोड़ने पर rear = 1 हो जाता है। इसके बाद एक और प्रविष्टि करने पर क्या होगा?)

(A) Resets front to 0

(B) Queue Overflow because (1 + 1) % 5 == 2 (equals front)

(C) Inserts at index 2

(D) Inserts at index 1

Correct Answer: (B)

[EN] With items at 2, 3, 4, 0, 1, all 5 slots are occupied and (rear + 1) % 5 == front triggers Overflow.

[HI] अब इंडेक्स 2, 3, 4, 0, 1 सभी भरे हैं और (1 + 1) % 5 == 2 (front) होने से Overflow हो जाएगा।

Q7. How do you avoid sacrificing one array slot in a Circular Queue that starts at front = 0, rear = 0?

(front = 0, rear = 0 वाली सर्कुलर कतार में 1 स्लॉट खाली छोड़े बिना सभी N स्लॉट उपयोग करने के लिए क्या जोड़ा जाता है?)

(A) Double the array at compile time

(B) Replace `% N` with `% (N - 1)`

(C) Maintain an explicit `size` / `count` variable (or a boolean `isFull` flag)

(D) Use `rear - front == 1` only

Correct Answer: (C)

[EN] Tracking active item count allows Empty (`count == 0`) and Full (`count == N`) cleanly without wasting a slot.

[HI] एक `count` वेरिएबल रखने से Empty (count==0) और Full (count==N) अलग-अलग पहचाने जाते हैं और पूरा N आकार उपयोग होता है।

Q8. In a Circular Queue, when `front == rear` (and `front != -1`), how many elements are present?

(सर्कुलर कतार में जब `front == rear` (तथा `front != -1`) हो, तो कतार में कितने तत्व होते हैं?)

(A) 0 elements

(B) MAX elements

(C) 1 element

(D) 2 elements

Correct Answer: (C)

[EN] Front and rear point to the exact same single occupied slot; deleting it resets both to -1.

[HI] front और rear दोनों एक ही एकमात्र तत्व की ओर इशारा करते हैं; इसे हटाने पर दोनों -1 हो जाते हैं।

Q9. Which CPU scheduling algorithm directly matches the Cyclic nature of a Circular Queue?

(कौन सा CPU शेड्यूलिंग एल्गोरिदम सीधे सर्कुलर कतार की चक्रीय प्रकृति का उपयोग करता है?)

(A) FCFS Batch without preemption

(B) Round-Robin Scheduling

(C) Non-Preemptive Priority

(D) Shortest Remaining Time First

Correct Answer: (B)

[EN] In Round-Robin, a process runs for one time quantum and, if unfinished, moves back to the rear of the circular ready queue.

[HI] Round-Robin शेड्यूलिंग में समय सीमा पूरी होने पर प्रक्रिया को कतार के पीछे (rear) वापस भेज दिया जाता है।

Q10. What happens if you use `rear = (rear + 1) % size` when `size = 1` and the queue currently holds 1 item at index 0 (front=0, rear=0)?

(यदि size = 1 की सर्कुलर कतार में इंडेक्स 0 पर 1 तत्व मौजूद है (front=0, rear=0), तो Full जांच `(rear + 1) % 1 == front` क्या देगी?)

(A) Returns -1

(B) Division by zero error

(C) False (1 != 0)

(D) True (0 == 0), correctly signaling Queue Full

Correct Answer: (D)

[EN] (0 + 1) % 1 evaluates to 0, which equals front (0), properly detecting that the 1-slot buffer is full.

[HI] (0 + 1) % 1 का मान 0 आता है जो front (0) के बराबर है, अतः यह कतार के पूर्ण होने की सही पहचान करता है।

Q11. Which is the main advantage of Circular Queue over Linear Queue?

(लीनियर कतार की तुलना में सर्कुलर कतार का सबसे बड़ा लाभ क्या है?)

(A) Automatically sorts items by priority

(B) Eliminates False Overflow and reuses vacated front slots in O(1) time

(C) Allows O(1) binary search inside queue

(D) Requires zero index variables

Correct Answer: (B)

[EN] Modulo wrap-around reclaims freed prefix slots immediately without shifting elements.

[HI] मॉड्यूलो रैप-अराउंड के कारण खाली हुए शुरुआती स्लॉट O(1) समय में पुनः उपयोग हो जाते हैं और फॉल्स ओवरफ्लो खत्म होता है।

Q12. If MAX = 7, front = 0, rear = 6 in a sentinel (-1) circular queue, why does `(rear + 1) % MAX == front` hold?

(यदि MAX = 7, front = 0 और rear = 6 है, तो `(rear + 1) % MAX == front` शर्त सत्य क्यों होती है?)

(A) (6 + 1) % 7 = 1, which equals front

(B) (6 + 1) % 7 = 7 % 7 = 0, which equals front

(C) Because 6 == 0 modulo 7

(D) Because rear < front

Correct Answer: (B)

[EN] This proves the same modulo check catches fullness even when no wrap-around has occurred yet.

[HI] (6 + 1) % 7 = 0 होता है जो front = 0 के बराबर है—अर्थात बिना रैप-अराउंड के भी यह सूत्र पूर्ण अवस्था पकड़ लेता है।

Q13. When implementing a Circular Queue with a Circular Singly Linked List, how many pointers are strictly necessary to support O(1) enqueue and dequeue?

(सर्कुलर सिंगली लिंक्ड लिस्ट से सर्कुलर कतार बनाने पर O(1) एनकतार व डिकतार के लिए कम से कम कितने पॉइंटर पर्याप्त हैं?)

(A) At least three pointers

(B) Only `front` (makes enqueue O(n))

(C) A doubly linked pointer array

(D) Only ONE pointer (`rear` / tail), because `rear->next` is always `front`

Correct Answer: (D)

[EN] In a circular linked list, `rear->next` directly points to the front node, enabling O(1) deletion at front and O(1) insertion after rear using just `rear`!

[HI] सर्कुलर लिंक्ड लिस्ट में `rear->next` हमेशा front नोड होता है, इसलिए केवल एक `rear` पॉइंटर से ही दोनों काम O(1) में हो जाते हैं।

Q14. In a 1-slot-reserved Circular Queue (MAX = 10, front = 8, rear = 3), how many elements are stored?

(1-स्लॉट-आरक्षित सर्कुलर कतार (MAX = 10, front = 8, rear = 3) में कितने तत्व संग्रहीत हैं?)

(A) 5

(B) 4

(C) 8

(D) 6

Correct Answer: (A)

[EN] In the 1-slot-reserved model (`front` points one before first or next free slot), count = (rear - front + MAX) % MAX = (3 - 8 + 10) % 10 = 5.

[HI] 1-स्लॉट-आरक्षित मॉडल में संख्या सूत्र `(rear - front + MAX) % MAX` से `(3 - 8 + 10) % 10 = 5` प्राप्त होती है।

Q15. What error occurs if `front` is updated using `front++` instead of `(front + 1) % MAX` in a Circular Queue?

(सर्कुलर कतार में `(front + 1) % MAX` के बजाय केवल `front++` लिख देने से क्या त्रुटि होगी?)

(A) front grows beyond MAX - 1 out of array bounds instead of wrapping to index 0

(B) Modulo operator throws compile warning

(C) rear becomes negative automatically

(D) The queue automatically becomes a Stack

Correct Answer: (A)

[EN] When items wrap around to index 0, `front++` at MAX - 1 walks past the end of the array instead of returning to 0.

[HI] MAX - 1 पर `front++` करने से पॉइंटर इंडेक्स 0 पर घूमने के बजाय एरे की सीमा से बाहर (out of bounds) चला जाएगा।

Q16. Which statement is NOT true about a Circular Queue?

(सर्कुलर कतार के बारे में इनमें से कौन सा कथन असत्य (NOT true) है?)

(A) Modulo arithmetic maps linear array indices onto a logical ring

(B) Enqueue and dequeue both execute in O(1) time

(C) Elements are physically moved in RAM whenever wrap-around occurs

(D) It resolves the False Overflow limitation of linear queues

Correct Answer: (C)

[EN] Data never shifts physically; only the front and rear integer indices wrap mathematically using modulo.

[HI] रैप-अराउंड के दौरान मेमोरी में तत्व कभी खिसकाए नहीं जाते—केवल front और rear सूचकांक मॉड्यूलो गणित से घूमते हैं।

Q17. Within Circular Queue: Modulo Arithmetic Implementation (rear+1)%size, which circular queue rule directly maps to: "rear = (rear + 1) % size"?

(Circular Queue: Modulo Arithmetic Implementation (rear+1)%size में कौन सा Circular Queue Rule सीधे "rear = (rear + 1) % size" से संबंधित है?)

(A) 1-Slot-Sacrificed Capacity

(B) Full Check (Sentinel -1)

(C) Next Rear Wrap-Around

(D) Empty Check (Sentinel -1)

Correct Answer: (C)

[EN] In Circular Queue: Modulo Arithmetic Implementation (rear+1)%size, 'Next Rear Wrap-Around' handles 'rear = (rear + 1) % size' (Wraps index size - 1 back to 0).

[HI] Circular Queue: Modulo Arithmetic Implementation (rear+1)%size में 'Next Rear Wrap-Around' का कार्य/विवरण 'rear = (rear + 1) % size' (Wraps index size - 1 back to 0) है।

Q18. Which option accurately describes 'Full Check (Sentinel -1)' in Circular Queue: Modulo Arithmetic Implementation (rear+1)%size?

(Circular Queue: Modulo Arithmetic Implementation (rear+1)%size के संदर्भ में 'Full Check (Sentinel -1)' की सही विशेषता कौन सी है?)

(A) size - 1 maximum usable slots

(B) (rear + 1) % size == front

(C) rear = (rear + 1) % size

(D) front == -1

Correct Answer: (B)

[EN] 'Full Check (Sentinel -1)' provides '(rear + 1) % size == front' — key point: Handles both normal & wrapped full states.

[HI] 'Full Check (Sentinel -1)' का मुख्य विवरण '(rear + 1) % size == front' है (Handles both normal & wrapped full states)।

Q19. In Circular Queue: Modulo Arithmetic Implementation (rear+1)%size, identify the correct parameter for the specification: "front == -1".

(Circular Queue: Modulo Arithmetic Implementation (rear+1)%size में "front == -1" विवरण किस विकल्प के लिए सही है?)

(A) Full Check (Sentinel -1)

(B) Next Rear Wrap-Around

(C) 1-Slot-Sacrificed Capacity

(D) Empty Check (Sentinel -1)

Correct Answer: (D)

[EN] 'Empty Check (Sentinel -1)' corresponds to 'front == -1' (Allows storing all `size` elements).

[HI] 'Empty Check (Sentinel -1)' का संबंध 'front == -1' (Allows storing all `size` elements) से है।

Q20. Considering Circular Queue: Modulo Arithmetic Implementation (rear+1)%size, what key behavior defines '1-Slot-Sacrificed Capacity'?

(Circular Queue: Modulo Arithmetic Implementation (rear+1)%size में '1-Slot-Sacrificed Capacity' की मुख्य भूमिका या मान क्या है?)

(A) (rear + 1) % size == front

(B) rear = (rear + 1) % size

(C) front == -1

(D) size - 1 maximum usable slots

Correct Answer: (D)

[EN] '1-Slot-Sacrificed Capacity' represents 'size - 1 maximum usable slots' (Required when front == rear marks Empty).

[HI] '1-Slot-Sacrificed Capacity' का अर्थ/मान 'size - 1 maximum usable slots' है (Required when front == rear marks Empty)।

Circular Queue: Modulo Arithmetic Implementation (rear+1)%size — Exam FAQs

Q1: Why do two valid textbooks report different maximum capacities (N vs N - 1) for a Circular Queue of array size N?

अलग-अलग किताबों में N साइज की सर्कुलर कतार की अधिकतम क्षमता कहीं N तो कहीं N - 1 क्यों लिखी होती है?

[EN] If the implementation uses a sentinel value like front = -1 to represent Empty (or maintains a `count` variable), all N array slots can hold items. If it instead uses `front == rear` to indicate Empty with no extra count flag, one slot must stay blank so Full `(rear+1)%N == front` stays distinct from Empty `front == rear`—leaving N - 1 usable slots.

[HI] यदि Empty दर्शाने हेतु front = -1 (या अलग `count` वेरिएबल) रखा जाए तो पूरे N स्लॉट उपयोग होते हैं। यदि बिना अतिरिक्त वेरिएबल के `front == rear` को Empty माना जाए, तो Full व Empty में भेद करने हेतु 1 स्लॉट खाली छोड़ना पड़ता है (क्षमता N - 1)।

Q2: Is it ever possible for front to become numerically larger than rear in a Circular Queue?

क्या सर्कुलर कतार में कभी front का इंडेक्स मान rear से बड़ा हो सकता है?

[EN] Yes, routinely! Whenever rear wraps around to 0, 1, 2 while front is still sitting at higher indices like 4 or 5, front > rear is completely normal in a circular queue.

[HI] हाँ, बिल्कुल! जब rear घूमकर 0, 1, 2 पर पहुँच जाए और front अभी भी 4 या 5 पर हो, तो सर्कुलर कतार में front > rear होना पूरी तरह सामान्य है।

Q3: When should we prefer a Linked-List Queue over a Circular Array Queue?

सर्कुलर एरे कतार की तुलना में लिंक्ड-लिस्ट कतार कब चुननी चाहिए?

[EN] Choose a Circular Array Queue when maximum buffer size is known upfront (embedded systems, ring buffers) for superior cache locality and zero malloc overhead; choose a Linked-List Queue when queue length fluctuates unpredictably with no hard upper limit.

[HI] जब अधिकतम आकार पहले से ज्ञात हो और तेज कैश प्रदर्शन चाहिए, तो सर्कुलर एरे चुनें; जब आकार अनिश्चित व लगातार घटता-बढ़ता हो, तो लिंक्ड लिस्ट चुनें।

Related Posts

  • Loading related posts...

Post a Comment

Search Topic Notes & 20 MCQs (Hindi / English)