A queue follows
-
FIFO
-
LIFO
-
both (a) and (b)
-
None of the above
Reveal answer
Fill a bubble to check yourself
A
Correct answer
Explanation
A queue follows FIFO (First In, First Out) - the first element added to the queue is the first one removed. This is like a line of people waiting where the first person to arrive is the first to be served.
AI explanation
A queue is a First-In-First-Out (FIFO) data structure: elements are added at the rear (enqueue) and removed from the front (dequeue), so the first element inserted is the first one removed. This is the defining property that distinguishes a queue from a stack, which follows LIFO (Last-In-First-Out) instead.