└── ArrayImplementation_of_StackADT.c++ /ArrayImplementation_of_StackADT.c++: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | //using namespace std; class stack 5 | { 6 | int stk[5]; int top; public: 7 | stack() 8 | { 9 | top=-1; 10 | } 11 | void push(int x) 12 | { 13 | if(top > 4) 14 | { 15 | cout <<"stack over flow"; return; 16 | } 17 | stk[++top]=x; 18 | cout <<"inserted" <=0;i--) cout <> ch; switch(ch) 45 | { 46 | case 1: cout <<"enter the element"; cin >> ch; 47 | st.push(ch); break; 48 | case 2: st.pop(); break; case 3: st.display();break; case 4: exit(0); 49 | } 50 | } 51 | return (0); 52 | } 53 | --------------------------------------------------------------------------------