Push
// add new data to the top of the stack
void push(int I)
{
if (top >= MAX)
{
cout << “The stack is full”;
return;
}
else
{ stack[top] = I;
top ++;
};
}
Previous slide
Next slide
Back to first slide
View graphic version