Skip to content

Stacks and queues (array-backed)

Handout

Two ways to hold items

  • A stack and a queue both hold a line of items, but they differ in which item comes out next.
  • A stack is LIFO: Last In, First Out — like a pile of plates.
  • A queue is FIFO: First In, First Out — like a line of people.

Handout

Log in or create account

IGCSE & A-Level