RE: What is the difference between ARRAY and STACK?
STACK follows LIFO. Thus the item that is first enetered would be the last removed.
In array the items can be entered or removed in any order. Basically each member access is done using index. No strict order is to be followed here to remove a particular element.
RE: What is the difference between ARRAY and STACK?
Array is a linear Data Structure in which insertion and deletion can take place in any position. The elements can be retrieved randomly in Arrays.
Stack is also a linear data structure in which insertion and deletion will take place at the top position alone. It follows LIFO order i.e. last in first out. The element in the top most position alone can be retrieved.
RE: What is the difference between ARRAY and STACK?
All the above comments are true but I want to add to it is that the size of array is fixed while in a stack its not fixed.It something like dynamic allocation.Its size can grow and shrink.