Which of the following principle does queue use?

By: Prof. Dr. Fazal Rehman | Last updated: February 3, 2024

Which of the following principle does queue use?

(A). LIFO

(B). FIFO

(C). Both

(D). None of these

Question’s Answer: FIFO

FIFO means first element added to the queue is the first one to be removed from queue.

Data Structure Principle
Queue FIFO
Stack LIFO
Array linear data structure without an inherent ordering principle
Tree hierarchical data structure without an inherent ordering principle
Linked List linear data structure without an inherent ordering principle

Example

Output

Queue size: 2
Front element: 5
Back element: 8
Queue size after two pops: 0
Queue is empty

 

All Copyrights Reserved 2025 Reserved by T4Tutorials