

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include
if(isempty()) cout<<"Stack is empty!\n"; else top--; } void show_top() { if(isempty()) cout<<"Stack is empty!\n"; else cout<<"Element at top is: "<<A[top]<<"\n"; } void displayStack() { if(isempty()) { cout<<"Stack is empty!\n"; } else { for(int i=0 ; i<=top; i++) cout<<A[i]<<" "; cout<<"\n"; }