Pergunta de entrevista da empresa Siemens

Explain the difference between a stack and a queue.

Resposta da entrevista

Sigiloso

5 de ago. de 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).