Pregunta de entrevista de Siemens

Explain the difference between a stack and a queue.

Respuesta de la entrevista

Anónimo

5 ago 2024

A stack is a data structure that follows the Last In, First Out (LIFO) principle, meaning that the last element added is the first one to be removed. Operations on a stack include push (adding an element), pop (removing the top element), and peek (viewing the top element without removing it).