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 the difference between hashmap and arraylist?
What is the minimum number of nodes that a binary tree can have?
Is pointer a variable?
List the data structures which are used in network data modal.
How many types of linked lists are there?
Define structure property in a heap?
Are data structures important?
Do you know what is linear search?
where do you use double linked list?
Can we store primitives in collections?
Explain pre-order and in-order tree traversal.
Why is treeset sorted?
Explain the most efficient method to reverse a linked list?
What is time complexity of hashmap?
What are two types of sorting?