answersLogoWhite

0


Best Answer

Briefly, there are two main differences between an array and a stack. Firstly, an array can be multi-dimensional, while a stack is strictly one-dimensional. Secondly, an array allows direct access to any of its elements, whereas with a stack, only the 'top' element is directly accessible; to access other elements of a stack, you must go through them in order, until you get to the one you want. I hope this answered your question.

OK?

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

An array is a contiguous block of memory.

A stack is a first-in-last-out data structure with access only to the top of the data.

Note that as the definition of a stack does not include how the actual data is stored, it can be backed by various other data structures, including arrays.

Note: C doesn't have built-in stack type.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

stack is derived from linear lists which intern as ordered collection of elements. it has a special feature that insertion and deletion can be done at only one end called Top of the Stack(TOP). It operated on first in first out method(FIFO).

Queue are also data structures just like stacks but has FIRST IN FIRST OUT fashion of operation.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

An array is a contiguously allocated container that permits random access but does not allow efficient growth unless additional space as reserved in which to grow. Thus insertions and extractions typically occur at the end of the array.

A queue is a container where elements are inserted at the end of the container and extracted from the beginning. Queues can be implemented in a variety of ways, including circular arrays and singly-linked lists but are generally more efficient when implemented as a modified deque (pronounced "deck"). A deque is similar to an array but allows efficient insertions and extractions at both ends of the sequence.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between stack and array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you implement stack without array?

Stacks are often implemented using the same node structure as a linked list.


What are the disadvantage of array implementation of stack?

Some immediate disadvantages:You'll have dead space in the array (entries which aren't currently used for items) taking up memoryYou'll have to keep track of the free entries - after a few insertions and deletions, these free entries could be anywhere.Using an array will impose an upper limit on the size of the linked list.


Which condition is not necessary in dynamic stack?

in dynamic stack we don't have to initialize the size of array while in static stack we have 2 initialize it ......


What is the main difference between stack and array?

ArrayIt is a data structure that has group of same type elements in linear sequence. It requires continuous memory block to store it. Elements in Array is accessed by index. Array does not have any predefined functions.StackIt is a data structure that is a list of ordered elements. In most of the programming languages and computer architecture stack has limitation in size. Elements in stack might not be the same type. Stack has predefined functions: POP (get top element), PUSH (put element on top) and it works by LIFO(Last In First Out) principle. Elements from stack are removed in reverse order to the order of their addition.Example:POP 1;POP 2;POP 3;Stack: (top) 3 2 1 (bottom)PUSHPUSHPUSHWe get elements in this order: 3 2 1


What the difference between protocol stack and protocol suite?

- In your own words, define the term 'protocol' and what is the difference between protocol and protocol suite

Related questions

What is the relationship between a stack and an array?

There is no inherent relationship between the two. It's possible to implement a stack using an array to store date, but that's about it.


What is the difference between a tree and a stack?

what is the causes of asthma


What is the difference between numeric array and associative array?

Numeric array has numbers(+integers) that represent the values Associative array has strings that represent the values


What is the difference between stack entry and stag entry in disco?

there is nothing called stack entry :p


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.


How do you implement stack without array?

Stacks are often implemented using the same node structure as a linked list.


Difference between vector and array list?

Vectors are thread safe but array lists are not. Hence array lists are faster than Vectors.


What are the disadvantage of array implementation of stack?

Some immediate disadvantages:You'll have dead space in the array (entries which aren't currently used for items) taking up memoryYou'll have to keep track of the free entries - after a few insertions and deletions, these free entries could be anywhere.Using an array will impose an upper limit on the size of the linked list.


What is the difference between Land Grid Array and Pin Grid Array?

One has pin in front, one has land


Which condition is not necessary in dynamic stack?

in dynamic stack we don't have to initialize the size of array while in static stack we have 2 initialize it ......


What do an array and a stack have in common?

Both are linear data structures.


What is the main difference between stack and array?

ArrayIt is a data structure that has group of same type elements in linear sequence. It requires continuous memory block to store it. Elements in Array is accessed by index. Array does not have any predefined functions.StackIt is a data structure that is a list of ordered elements. In most of the programming languages and computer architecture stack has limitation in size. Elements in stack might not be the same type. Stack has predefined functions: POP (get top element), PUSH (put element on top) and it works by LIFO(Last In First Out) principle. Elements from stack are removed in reverse order to the order of their addition.Example:POP 1;POP 2;POP 3;Stack: (top) 3 2 1 (bottom)PUSHPUSHPUSHWe get elements in this order: 3 2 1