Stack data structure is implement in c language using arrays
Stack is a data stucture using the logic LIFO ( Last In First Out ), the entry and exit of data in the data structure happens only through one point called as the top. Imagine a stack of plate, plate taken will be the top most plate and the plate that will be added will be on top of the top most plate Similarly, the data will pushed at the top and will be poped at the top.
Necessary functions,
- push() - to push in new elements inside the data structure
- pop() - to take out the elements from the top
- peek() - to know what element is at the top most point
- isfull() - to check whether the stack is full or not
- isempty() - to check whether the stack is empty or not