Which principle is followed by a standard queue data structure?

Options

  • A. LIFO
  • B. FIFO
  • C. FILO
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. FIFO

Detailed Explanation

A standard queue follows the FIFO (First In, First Out) principle. The element inserted first is removed first, similar to people standing in a line. In a queue, insertion is normally performed at the rear using an enqueue operation, while deletion is performed at the front using dequeue. In contrast, a stack follows LIFO, meaning Last In, First Out.