How is it possible to insert different type of elements in
stack?
Answer Posted / sudipto ghosh
yes it is possible to insert different types of element in a
stack.
insted of defining the member as int or float or so on. we
will define each element as a union which will be consisting
of all types of data type and only one can be used at a
time. in order to determine which type of element is being
pushed or poped we will define a flag with in union which
keeps the track of data type being used.
Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
What is adt in data structure?
Can we add duplicate keys in a hashmap? What will happen if we attempt to add duplicate values?
How is the front of the queue calculated ?
What is meant by arraylist?
which is the simplest file structure? (Sequential, indexed, random)
What is collections singletonlist?
What is a list of lists?
What is the difference between a hashmap and hashtable?
Is hashmap fail safe?
Why is bubble sort stable?
Differentiate between queue and stack.
What is a static structure?
What is an object array?
Provide an algorithm to reverse a linked list without using recursion.
What is the order of b tree?