Are you sure you're getting this? Click the correct answer from the options.
What is the main difference between a stack and a queue?
Click the option that best answers the question.
- A stack follows the LIFO (Last In First Out) principle, while a queue follows the FIFO (First In First Out) principle.
- A stack can have elements of different data types, while a queue can only have elements of the same data type.
- A stack can only be implemented using a linked list, while a queue can only be implemented using an array.
- A stack can have an unlimited number of elements, while a queue has a fixed size.