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


Please Help Members By Posting Answers For Below Questions

Why it is said that searching a node in a binary search tree is efficient than that of a simple binary tree?

760


What is the order of selection sort?

600


What is the Difference between sax and dom parser?

724


Is hashmap ordered?

724


What is Jagged Arrays?

712






What is int data type?

699


Is learning data structures necessary?

629


What is the heap in data structures?

705


How will you represent a linked list in a graphical view?

800


What is a hashset?

670


How do you find the number of comparisons in bubble sort?

677


Explain the priority queue?

700


What is push and pop in stack?

583


When would you use a tuple?

619


What are the non linear data structure?

635