Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

simplest code for stack implementation in c++

void display() {
   if(top>=0) {
      cout<<"Stack elements are:";
      for(int i=top; i>=0; i--)
      cout<<stack[i]<<" ";
      cout<<endl;
   }else
   cout<<"Stack is empty";
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #simplest #code #stack #implementation
ADD COMMENT
Topic
Name
2+6 =