Page 5 - Fundamentals of Stack in Data Structure
P. 5

int Stack::pop()


               {



               if(top < 0)


               {


               cout << "Stack Underflow";



               return 0;


               }


               else



               {


               int d = a[top--];


               return d;


               }



               }





               void Stack::isEmpty()


               {



               if(top < 0)


               {


               cout << "Stack is empty";
   1   2   3   4   5   6   7   8   9   10