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 data structure in programming language?
How does hashset work internally in java?
What is the use of threaded binary tree?
Define structure property in a heap?
What is the order of selection sort?
Explain extended binary tree.
How many types of lists are there?
Mention a few applications of linked lists?
Traverse the given tree using Inorder, Preorder and Postorder traversals. Inorder : D H B E A F C I G J Preorder: A B D H E C F G I J Postorder: H D E B F I J G C A
Which algorithm is used in arrays sort?
Can we search the data in a linked list?
What are different types of linked lists?
What are the objectives of studying data structures?
Define distributed query and linked server?
Does hashmap maintain insertion order?