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