Revature interview question

What is the difference between a queue and a stack?

Interview Answer

Anonymous

10 Dec 2020

A stack is an ordered list of elements where all insertions and deletions are made at the same end, whereas a queue is exactly the opposite of a stack which is open at both the ends meaning one end is used to insert data while the other to remove data. stack is known as lifo and queue is kniwn as fifo rule .

1