answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

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

Wiki User

11y ago

Use the array to maintain pointers to each stack.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you implement stack without array?
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.


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

stack abstract datatype


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.


Can you implement merge sort without using recursion?

Sure, recursion can always be substituted with using a stack.


Write a java program to implement stack in java?

You would need an array to store the actual stack. Better use an ArrayList or some other structure that you can redimension. You'll also need a variable to point to the "top of stack" - the last element added, which is the first element to be taken away.


Is it possible to implement stack and queues using linkes list?

Yes it is possible to implement stack and queue using linked list


Explain The merits of using a deque to implement a stack in data structure?

Explain The merits of using a deque to implement a stack in data structure


Queue ADT Using Array?

implement the queue ADT using an array


What are advantages of stack?

some disadvantages created in stack using array then that problem solve to linked list use in stack.First advantage for size of stack not limited in linked list using.second essay to stack programme implement using only one pointer.


Can heap implement recursion?

Heap is a data-structure, it cannot implement anything. On the other hand, it is true that: 1. Recursive routines might use heap. 2. You can use dynamic memory allocation (heap), to implement a stack; and use the stack to implement recursion.


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 importance of stack algorithm in your program?

Stack implementations allow us to easily implement backtracking algorithms.