ARRAY IMPLEMENTATION OF STACK
Hi guys, In this post I would like to discuss about the simple concept, stack.For easy understanding I have implemented the stack using array.In the next post I will discuss with you about the implementation of stack using the linked list (Stack ADT).
A Stack is a restricted form of list, where the insertion and deletion can be performed only in the top of the list.Each time when the insertion is performed, the element is inserted into the stack it is inserted into the top of the stack.This insertion operation is called as push operation.The pop operation deletes the most recently inserted element. Sometimes Stack is also called as LIFO list (Last In First Out).In Stack model only the top elements are accessible.
Code for Stack:
int a,i,n,top=-1,x=0,item,ch; //global declaration of stack array.
printf(“\nEnter your choice:”);
printf(“\nEnter the size: “);
int isfull(int x)