Ds program
- 1. Stack usingan array
#include<iostream .h>
#include <conio.h>
#define ms5
Class stack
{
Int a[ms],size ,top;
Public:
Stack(int n);
{
Size =n;
Top=-1;
}
Void push();
Void push();
Void display();
};
Void stack::push()
{
Int x;
If(top<=size-1)
{
Cout<<”enter the value”;
Cin>>x;
top++;
a[top]=x;
}
else
cout<<”stackis overflow”;
}
Void stack::pop()
{
int y;
if(top==-1)