40.8k views
3 votes
write a c program to insert and delete values from stack( to perform pop and push operations) using an array data structure

User Test Team
by
4.0k points

1 Answer

2 votes

Answer:

How to implement a stack in C using an array?

A stack is a linear data structure that follows the Last in, First out principle (i.e. the last added elements are removed first).

This abstract data type​ can be implemented in C in multiple ways. One such way is by using an array.

​Pro of using an array:

No extra memory required to store the pointers.

Con of using an array:

The size of the stack is pre-set so it cannot increase or decrease.

write a c program to insert and delete values from stack( to perform pop and push-example-1
write a c program to insert and delete values from stack( to perform pop and push-example-2
User Crerem
by
5.1k points