implementation of stack using an array
Answers
Hi,
I do not just wanna give you answer, but also want to make you understand what array is in programming languages.
So array is collection of values, usually array looks like this, almost in every programming language:-
[1, 2, 3, 4, 5, 6, 8, 9 , 10]
I fill that array with just some dummy number but in real world we use array to store values like id of products that you have added in your cart while doing online shopping, on print those items on webpage with the help of loop.
But how we can add 0 in start of that array?, how can we remove that 10 from array? How can we print those values of array?
We can do this by Implementation of Stack Using Array.
The C Program is written for implementation of STACK using Array, the basic operations of stack are PUSH(), POP() and DISPLAY().
PUSH function in the code is used to insert an element to the top of stack,
POP function used to remove the element from the top of stack.
Finally display function used to print the values at any time.
All stack functions are implemented in C Code.