Multiple choice

Which data structure is first-in-first-out?

  1. Stack

  2. Queue

  3. Linked list

  4. Binary tree

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A queue follows the First-In-First-Out (FIFO) principle, where the first element added is the first one to be removed. This is analogous to a line of people waiting for service.