Press Undo in any editor and your latest change disappears first. Send three documents to a printer and the first one comes out first. Behind these two everyday habits are two of the simplest and most useful structures in computing: the stack and the queue. Give both the same instructions and watch them give different answers.
This article and its interactive demo were created with the help of generative AI and editorially reviewed.
