What is the difference between ARRAY and STACK?

Questions by ramesh_etta

Showing Answers 1 - 5 of 5 Answers

rose

  • Nov 10th, 2006
 

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.

  Was this answer useful?  Yes

Pushpa Siva Kumar

  • Dec 14th, 2006
 

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.

  Was this answer useful?  Yes

Jyotiranjan

  • Mar 1st, 2007
 

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.

  Was this answer useful?  Yes

j4jrm84

  • Mar 1st, 2007
 

Basic Difference is that the size of array is fixed while stack size can grow and shrink.Stack is a dynamic concept

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions