Question 2/3
What is the difference between a stack and a queue in data structures?
A stack is a last-in-first-out (LIFO) data structure. A queue is a first-in-first-out (FIFO) data structure.
A stack is a data structure that stores data in a linear order. A queue is a data structure that stores data in a circular order.
A stack is a data structure that is used to implement the back button in a web browser. A queue is a data structure that is used to implement the print job queue in an operating system.
A stack is a data structure that is used to implement the undo operation in a text editor. A queue is a data structure that is used to implement the redo operation in a text editor.
1 answer
The correct answer is: A stack is a last-in-first-out (LIFO) data structure. A queue is a first-in-first-out (FIFO) data structure.