Domanda di colloquio di Amazon

What is the difference between a stack and a queue?

Risposta di colloquio

Anonimo

26 mag 2009

Stack and queue are both a way of storing the data,but the way the data is retrieved brings out the difference among them.A stack follows LIFO approach,which is, an element that is placed in the stack first comes out last.And Queue follows FIFO approach.The element that goes in first, comes out first.

5