हिंदी माध्यम नोट्स
Stack : Implementation Using Linked List in c language in hindi , स्टैक को लिंक लिस्ट का उपयोग करने इम्प्लीमेंट करना
स्टैक को लिंक लिस्ट का उपयोग करने इम्प्लीमेंट करना , Stack : Implementation Using Linked List in c language in hindi :-
Stack को दो प्रकार से Implementation कर सकते है (i) using array (ii) using linked list |linked लिस्ट की तुलना मे array मे push (insertion ) और pop (delete) operation को करना easy होता है |लेकिन array के साथ dynamic memory एलोकेशन possible नहीं है | इस कमी को दूर करने के लिए stack को linked लिस्ट से
Implementation किया जाता है | linked लिस्ट run time पर memory allocate करती है |इसलिए stack Implementation using linked list ही सबसे ज्यादा अपनाया जाता है |
push operation की algorithm है :-1. सबसे पहले एक नये node new 1 को बनाया जाता है जिसमे data value को assign होती है |
pop operation की algorithm है :-
1.सबसे पहले stack की emptyness को check किया जाता है |अगर stack empty है तब empty stack का message आ जायेगा |
इस प्रोग्राम मे , char function है :
1.main() : इस function मे , प्रोग्राम की main body होती है |जिसमे सभी function push() ,pop() और display_stack () को call किया जाता है |
2.push() : इस function का use ,stack array मे element को add करने के लिए किया जाता है |
3.pop() : इस function का use , stack element मे element को डिलीट करने के लिए किया जाता है |
4.display_stack() : इस function का use ,stack के सभी element को display करने के लिए किया जाता है |
सबसे पहले ,header portion मे एक structure को declare किया गया है | जो की linked लिस्ट एक node को define करता है | इसका एक variable है जिसका नाम head है |
main() मे ,
इस function मे ,
1.सबसे पहले दो variable ch , और new को declare किया गया है | (i) ch मे , यूजर द्वारा दिए गये choice को assign किया जाता है |और (ii) new मे , यूजर द्वारा दिए गये नए data को assign किया जाता है |
‘2’ से pop operation होगा |
‘3’ से display operation होगा |
‘4’ से exit operation होगा |
यूजर द्वारा दिए गये input के आधार पर हो function को call किया जाता है |
push operation :
1.सबसे पहले एक variable newdata को declare किया जाता है जिसका data type struture employee है|
4.ii-temp को temp के address field मे store address से increment कर देगे |
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
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…