GeekInterview.com
Series: Subject: Topic:
Question: 98 of 249

What is the difference between ARRAY and STACK?

Asked by: ramesh_etta | Member Since Nov-2006 | Asked on: Nov 8th, 2006

View all questions by ramesh_etta

Showing Answers 1 - 5 of 5 Answers
rose

Answered On : 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.

  
Login to rate this answer.
Pushpa Siva Kumar

Answered On : 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.

  
Login to rate this answer.

Arrays : stored in random orderStack: stored in LIFO order.

  
Login to rate this answer.
Jyotiranjan

Answered On : 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.

  
Login to rate this answer.
j4jrm84

Answered On : Mar 1st, 2007

View all answers by j4jrm84

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

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.