Which of the below are examples of Stack 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
Generally in Hotels new cup will be placed on existing pile of cups. And when we want to take away the cups from that pile, then last piled cup will be removed first. So it is Last In First Out.
Back To Top