Algorithm to Insert an Element in a Circular Queue

हेलो स्टूडेंट्स, इस पोस्ट में हम आज Algorithm to Insert an Element in a Circular Queue के बारे में पढ़ेंगे | इंटरनेट में C++ भाषा के नोट्स हिंदी में बहुत कम उपलब्ध है, लेकिन हम आपके लिए यह हिंदी में डिटेल्स नोट्स लाये है, जिससे आपको यह टॉपिक बहुत अच्छे से समझ आ जायेगा |

Assuming that the circular queue is stored in QU with size N.

<br /> Check if Queue already filled or not<br /> Step 1.if (FRONT = 1 and REAR = N) or (FRONT = REAR + 1) then<br /> {<br /> write “Overflow !!”<br /> }<br /> else<br /> {<br /> Step 2.if FRONT = NULL then<br /> {<br /> set FRONT = 1<br /> REAR = 1<br /> }<br /> Step 3.else if REAR = N then<br /> set REAR = 1<br /> else<br /> Step 4.set REAR = REAR + 1<br /> }<br /> // end of if<br /> Step 5.set QU[REAR] = I_ITEM // (to insert the new item I_ITEM<br /> Step 6.return.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20Check if Queue already filled or not Step 1.if (FRONT = 1 and REAR = N) or (FRONT = REAR + 1) then { write “Overflow !!” } else { Step 2.if FRONT = NULL then { set FRONT = 1 REAR = 1 } Step 3.else if REAR = N then set REAR = 1 else Step 4.set REAR = REAR + 1 } // end of if Step 5.set QU[REAR] = I_ITEM             // (to insert the new item I_ITEM Step 6.return.

Also read : Collision Resolution Techniques in hindi

This is the algorithm to insert an element in a circular queue.

If you have any query then tell me by commenting below.

अपने दोस्तों के साथ share कीजिये.

Related

हम आशा करते है कि यह Algorithm to Insert an Element in a Circular Queue के हिंदी में नोट्स आपकी स्टडी में उपयोगी साबित हुए होंगे | अगर आप लोगो को इससे रिलेटेड कोई भी किसी भी प्रकार का डॉउट हो तो कमेंट बॉक्स में कमेंट करके पूंछ सकते है | आप इन्हे अपने Classmates & Friends के साथ शेयर करे |

Leave a Comment

Your email address will not be published. Required fields are marked *