हिंदी माध्यम नोट्स
Queues : Basic in c language in hindi , what is Queue in c , c कंप्यूटर भाषा में क्यु क्या है हिंदी में
Queues मे data को Queues के front मे add किया जाता है और data को डिलीट को Queues के end मे से किया जाता है |Queues मे जहा से add operation perform होता है उसे front कहते है |और जहा से डिलीट operation perform होगा use rear कहते है |
किसी Queues को define करने के लिए निन्म variable को use किया जाता है :-
1.Queues[] : ये array होती है जो की Queues के तरह कार्य करेगी
2.size: ये Queues array की size होती है |
3.front : ये Queues का front भाग होता है जहा से insert operation perform होता है |
4.rear : ये Queues का पीछे वाला भाग होता है जहा से डिलीट operation perform होता है |Queues मे निन्म operation perform हो सकते है :-
1.EnQueues
इस function मे Queues मे data को add किया जाता है |अगर Queues फुल होती है तब इसे overfull condition कहते है |इसकी algorithm है :-
1.सबसे पहले rear की value check होती है |
2 अगर rear की value arraysize से सामान होती तब
2.i-overfull condition का message आ जाता है \
2.ii-अन्यथा Queues के rear position पर item insert हो जाता है और Queues के rear की position बढ़ जाती है |
इस operation की complexity O(1) होती है क्योकि इसमें एक ही बार operation होता है |
2.DeQueues
इस function का use , Queues से data को डिलीट करने के लिए किया जाता है |अगर Queues empty है तब underflow condition आ जाती है |इसकी algorithm है :-
1.सबसे पहले condition check की जाती है |
2.अगर Queues का front और rear की value same होती है तब
2.i underflow condition आ जाती है |
2.ii-Queues के front पोसितिओंके element को ‘0’ से रिसेट कर देते है |और front को एक position से decrement कर देगे |
3.front()
इस function मे Queues के front position पर उपस्थित element को return किया जाता है |अगर Queues array का नाम Queues[] है तब
int front(Queues[])
{
return(Queues[front]);
}
4.Size ()
इस function का use , Queues की size को calculate करने के लिए किया जाता है |अगर Queues array का नाम Queues[] है जिसमे
front : जो की Queues[] के first position की value को contain करता है |
rear : ये Queues[] के last position की value को contain करता है |
तब Queues की size = rear-front;
size(int rear,int front)
{
size =rear-front;
return(size);
}
5.is empty ()
ये function Queues के status को check करता है |अगर function ‘1’ return करे तो Queues empty है |अन्यथा Queues मे element है |
Double Ended Queues
Queues दो प्रकार की होती है इस article मे केवल Double Ended Queues को पढेगे |Circular Queues के लिए एक अलग से chapter उपलब्ध है |
single Queues मे,कोई भी data Queues के front से डिलीट होता है और insert Queues के rear होता है |लेकिन Double Ended Queues मे data दोनों side ( front या rear ) से insert और डिलीट हो सकता है |इसलिए इसे Double Ended Queues भी कहते है |
Double Ended Queues मे निन्म operation perform हो सकते है :-
1.insert at back side
इस operation की algorithm,Queues की enQueues के तरह होती है | इसकी algorithm है :-
1.सबसे पहले rear की value check होती है |
2 अगर rear की value arraysize से सामान होती तब
2.i-overfull condition का message आ जाता है |
2.ii-अन्यथा Queues के rear position पर item insert हो जाता है और Queues के rear की position बढ़ जाती है |
2.Delete from back
इस operation के लिए algorithm होती है :-
1.condition check की जाती है |
2.अगर front और rear की value same होती है तब
2.i- underflow की condition आ जाती है |
2.ii-अन्यथा rear को rear-1 से set करते है और Queues के rear position पर ‘0’ को assign करते है |
3.Insert at front
इस operation के लिए algorithm होती है :-
1.condition check की जाती है |
2.अगर front की value 1 होती है तब
2.i- item can not add का message आ जाता है |
2.ii-अन्यथा front को front -1 से set करते है और Queues के front position पर data assign करते है |
4.Delete at front
इस operation की algorithm,Queues की enQueues के तरह होती है | इसकी algorithm है :-
1.सबसे पहले front की value check होती है |
2 अगर rear और front की value सामान होती तब
2.i-overfull condition का message आ जाता है |
2.ii-अन्यथा Queues के front position पर item insert हो जाता है और Queues के front की position बढ़ जाती है |
5.front()
इस function मे Double Ended Queues के front position पर उपस्थित element को return किया जाता है |अगर Queues array का नाम Queues[] है तब
int front(Queues[])
{
return(Queues[front]);
}
int front(Queues[])
{
return(Queues[rear-1]);
}
इसके अलावा size() और is empty () function भी perform होते है |जिसकी algorithm नार्मल Queues की तरह होती है |
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…