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
Define non linear data structure.
What is the difference between hashset and treeset?
Is list a data type?
Explain the sorting algorithm that is most suitable to be used with single linked list?
Given M x N matrix with sorted elements row wise and column wise, find elements?
What is difference between data type and data structure?
What is definition list?
What are the pre-requisite for the collection to perform binary search?
Is treeset synchronized?
What is the method to find the complexity of an algorithm?
What is binary search in data structure?
Is radix sort faster than quicksort?
Can a binary tree be empty?
What is hashing with example?
Why you need a data structure?