answersLogoWhite

0


Best Answer

Some immediate disadvantages:

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

Wiki User

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

Wiki User

11y ago

stack using array first not declare stack size and not limited data store in stack.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the disadvantage of array implementation of stack?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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

stack abstract datatype


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.


Is cursor implementation possible in queue or stack?

yes,cursor implementation possible in priority queue.


Representation of stack data structure in c plus plus?

Stack is an abstract data type that allows you to input and output data in a way that the first data which was placed in the stack will be the last one to get out. We use physical examples of stack in our daily lives such as the stack of dishes or stack of coins where you only add or remove objects from the top of the stack. You can see the implementation in c++ in related links, below.


How do you implement stack without array?

Stacks are often implemented using the same node structure as a 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.


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.


What time required to insert element in stack with linked implementation?

O(1)


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.