Answer explained
Explain a stack.
A stack is a linear LIFO structure. PUSH adds at the top, POP removes the top item, and PEEK/TOP reads it without removal. It is used for calls, undo and expression evaluation.
A stack is a linear LIFO structure. PUSH adds at the top, POP removes the top item, and PEEK/TOP reads it without removal. It is used for calls, undo and expression evaluation.