answersLogoWhite

0


Best Answer

Both are linear data structures.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do an array and a stack have in common?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


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


C program to implement tower of hanoi using array implementation of stack abstract datatype?

stack abstract datatype


How can I fix Stack overflow at line 156?

A stack overflow is usually the cause of an array that is too small to be able to hold the intended data. To fix a stack overflow, the array must be locally declared (this means not dynamically allocated off of the heap) and then you must change the amount of "slots" in the array to something that is big enough to hold your data.


Why you will declare top as -1 for stacks to be empty in c program?

You would do this if you implement a stack using an array. Using a zero-based index to keep track of the top of the stack (the end of the array) means we must use the value -1 to indicate an empty stack. This is because an array of n elements will have indices 0 through n-1, where index n-1 represents the element at top of the stack. An empty stack has 0 elements, therefore the top of the stack is represented by index -1.


What is Stack overflow at line?

A stack overflow is a type of buffer overflow in which an array writes memory outside of the array boundaries. The keyword here is "stack". The stack is a section in memory in which local variables and other program data are kept for future reference. When the stack gets overflown, adjacent program memory, such as variables, pointers, etc, will be overwritten and cause your program to crash.


How do you use push operation in stack give the exampale of the program?

A stack can be implemented as an array or a list. If an array, simply push the new element onto the end of the array. If a list, point the new node at the head node then make the new node the new head of the list.


What is the meaning of a stack overflow?

A stack overflow is a programming term used to identify when a function tries to access memory from a stack that does not exist. A stack, such as a queue or array, contains a limited number of memory spaces set aside when it is created. For example, if an array has 8 objects in it and a function tried to access an item at slot nine, which doesn't exist, it would cause a stack overflow.


What is the synonym of bundle?

package, collection, bag, array, pack, quantity, stack


What are the the two ways in representing the stack?

one-dimensional array, and doubly-linked list.