Which of the below are examples of Queue data structure?
i. People standing in a line to get movie tickets.
ii. pile of cups arranged in a hotel.
iii. pile of processes waiting to be executed with CPU
i & iii
ii & iii
Both people standing in a line to get movie tickets, and processes standing in a line to get CPU time, both will happen in the order of First In First Out manner. That is new person can enter the line in the last only, and who ever entered the line first, he will go out first. so it is First In First Out.
Back To Top