Types of elements in a stack

Is it possible to insert the various types of elements in a stack? Explain how?

E

Expert

Verified

The various elements can be inserted into the stack. This is possible through implementing union/structure data type. This is efficient to use union instead of structure, as the only one item’s memory is employed at a time.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.