answersLogoWhite

0

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

16y ago

What else can I help you with?

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.


Difference between vector and array list?

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


What is the minimum absolute difference between any two elements in a given array?

The minimum absolute difference between any two elements in a given array is the smallest positive number that can be obtained by subtracting one element from another in the array.


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 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