Question: what is the basic difference between stack and queue?
Answer: 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. The main difference between the two is their working mechanism.