Possibility to insert different type of elements in a stack

How is this possible to insert different type of elements within a stack?

E

Expert

Verified

Various elements can be inserted within a stack. It is possible by implementing union or structure data type. This is efficient to employ union quite than structure, as only individual item’s memory is utilized at a time.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.