What is the difference between a stack and a queue?
Anonym
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.