Suggest an editImprove this articleRefine the answer for “How does a queue differ from a stack?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**A queue and a stack** differ in the order elements are processed: a stack follows **LIFO** (last in, first out), while a queue follows **FIFO** (first in, first out). **Key point:** technically, a stack adds and removes at one end, while a queue adds at the tail and removes at the head.Shown above the full answer for quick recall.Answer (EN)ImageA queue and a stack differ in **the order in which elements are processed**: - **Stack**: the **LIFO (Last In, First Out)** principle: last added, first out. Example: a stack of plates: you take the top one first. - **Queue**: the **FIFO (First In, First Out)** principle: first added, first out. Example: a line in a store: whoever arrived earlier leaves earlier. Technically: - In a **stack**, additions and removals happen **at one end** (the top). - In a **queue**, **additions happen at the tail**, **removals at the head**. Summary: a stack keeps order "backward", a queue keeps order "forward".For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.