Stack Operation in Hindi

Hello दोस्तों! आज मैं आपको इस पोस्ट में what is Stack Operation in Hindi) के बारें में बताऊंगा, और , तो चलिए शुरू करते हैं

what is Stack Operation

Stack पर मुख्यतः दो प्रकार के operation को perform किया जाता है

  •  Push operation

  • Pop operation

 Push operation:- top पर कोई भी नया element डालना या जोड़ना push operation कहलाता है जब भी push operation होता है top में एक संख्या डाली जाती है और top एक level बढ़ता है ऐसा करते करते एक level पर आकर वह पूरा भर जाता है तो वह स्थिति stack-full स्थिति कहलाती है।

Algorithm to insert an element to a stack

PUSH(STACK,TOP,MAX,STK,ITEM)

(1) [Stack already filled]

if TOP=MAX,STK

than Print: Over Flow and return

(2) Set TOP=TOP+1(increase top by 1)

(3) set STACK[TOP]=ITEM(item inserted)

(4) EXIT.

 

 Pop operation:-  top पर से element delete करने की क्रिया को pop operation कहते हैं हर pop operation के बाद stack एक level कम हो जाता है सारे element खत्म होने के बाद stack underflow की स्थिति में पहुंच जाता है।

Algorithm to Delete an Element to a Stack

POP(STACK,TOP,ITEM)

(1) If TOP=0

then print Underflow and return.

(2) set ITEM= STACK[TOP] (assigns TOP element to ITEM)

(3) Set TOP=TOP-1(item deleted)

(4) EXIT.

Note:- ये पोस्ट आपको कैसी लगी आप कमेंट कर के बताईये !अगर आपको कुछ पूछना या अपनी राय देनी  हो तो आप हमे कमेंट या itpolynotes@gmail.com पे  ईमेल करके बता सकते है हम पूरी कोसिस करेंगे की आपका रिप्लाई जल्दी से जल्दी दे सखे ….

 

Leave a Comment