hello-algo/en/docs/chapter_stack_and_queue/index.md

324 B

Stack and Queue

Stack and Queue

!!! abstract

A stack is like cats placed on top of each other, while a queue is like cats lined up one by one.

They represent the logical relationships of Last-In-First-Out (LIFO) and First-In-First-Out (FIFO), respectively.