answersLogoWhite

0


Best Answer

stack is a linear data structure in which data item is either inserted or deleted at one end there are mainly two operations performed on stack.they're push poppush:writing a value to the stack is push or moving the stack pointer up to accomodatethe new item. pop:reading a value from stack or moving the stack pointer down.

User Avatar

Wiki User

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

Wiki User

13y ago

Different elements can be inserted into a stack. This is possible by implementing union / structure data type. It is efficient to use union rather than structure, as only one item's memory is used at a time

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

1.Using struct, we can store different data types like int, float, double, char, etc.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you add different type of data in a stack?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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.


What is type specific data in ASF file format How it is calculated for different codecs Is it mandatory to add this data in ASF file?

caca


Can you stack no xplode and volumaize by bns?

Yes, they're completely different. Volumaize will not add to the jitters


What is a stack and how do you represent a stack in computer memory also discuss basic operation performed on a stack?

A stack is an abstraction of First-in-last-out, or the last in first out. The basic operations (may bear different names) Push or Add Pop or Next


What are different words for 'add'?

Exactly Which type of add,add as in addition or add in .......


When you add or subtract a certain value from a data set?

You may or may not get a different data set.


Is stack a physical data structure?

Traditional implementations of stacks, particularly those implemented in hardware, are generally physical data structures. That is, the data structure dictates how elements are arranged in memory.Modern software implementations take a more abstract approach however. Characteristic for a stack is not the physical arrangement of items in memory, but the set of characteristic operations and their behavior: a simple stack can execute push operations to add an item and pop operations to remove the most recently added item. More advanced stacks support additional stack operations to manipulate implicitly addressed stack elements, for example though common operations such as dup, swap, drop.Nothing in the behavior of these stack operations dictate that the stack shall be implemented as a physical data structure; in fact many modern runtime kits use higher order data structures such as linked lists to implement stacks and other basic data structures. Such a choice would be made to support an infinite size stack, for example, and in order to base the runtime kit on the smallest number of fundamental tools in order to promote robustness.


How far from stack can you add new wye for toilet in basement?

As long as there is a cleanout on the stack, 25 feet


Can you add data to a flash drive without overwriting previous data?

Yes Just save it under a different name


What happens when you add primitive data type into a collection in java?

how do you get the value of the parameter in the applet


What is a stack data explain with example in data structure?

One way to emulate a stack with a data structure is with a singly linked list wherein you can only add and remove nodes from the head or tail of the list (depending on implementation). An easy and straightforward application of this type of data structure would be a reverse polish notation calculator where values can be pushed onto the data structure and then popped when one comes across an arithmetic symbol.


What does it mean that the stack is a LIFO structure?

LIFO stands for Last In First Out. It basically means that the most recent piece of data added to a list, will be the first piece that is taken off. It is often compared to a stack of plates. When you have a plate to add to the the stack, you put it on the top, not in the middle or at the bottom of the stack. If you need a plate you usually take it from the top, not the middle or bottom. So the most recent plate on the top is the first that will be taken off when one is needed.