What is the difference between a stack and a queue?
Q1. What is the difference between a stack and a queue?
Answer: A stack is LIFO, while a queue is FIFO
Explanation: A stack follows the Last-In-First-Out (LIFO) principle, while a queue follows the First-In-First-Out (FIFO) principle, making them suitable for different applications.