Multiple choice technology programming languages

Which of the following is true?

  1. Stack is a data structure that is based on First-in-First-Out (FIFO) rule

  2. Queues are based on Last-In-First-Out (LIFO) rule

  3. Neither (a) nor (b)

  4. Both (a) and (b)

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

Stack follows LIFO (Last-In-First-Out) - the last element pushed is the first one popped. Queues follow FIFO (First-In-First-Out) - the first element enqueued is the first one dequeued. Therefore neither statement (a) nor (b) is correct.