Which of the following data structures stores the data in FIFO mode?
-
LinkedList
-
Binary Tree
-
Stack
-
Queue
-
Array
D
Correct answer
Explanation
A queue is a data structure which stores the data in First In First Out Mode. A queue consists of two sides - front and rear. The nodes are added from the rear side and removed from the front side just like people join a queue from the end and pull out from the beginning in a real life queue. The node that was added the first is also the first one to be removed.