Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are basic algorithms?

952


When ArrayIndexOutOfBoundsException occurs?

1185


What is a queue in data structure?

1064


What is long data type?

1073


Define graph?

1166


Which sorting algorithm has minimum number of swaps?

939


How many null values are allowed in a set?

948


What is homogeneous array?

916


An array having 100 elements have numbers from 1 to 99 randomly out of which any number is repeated. Find the repeated number in minimum time and space complexity.

1227


What is the time complexity of selection sort?

909


What does arraylist remove return?

975


Can you dynamically allocate arrays in expanded memory?

1096


Explain heapsort. What is its complexity?

1033


Which is best array or linked list?

956


What do you mean by 2-3-4 tree?

1044