In which scenario would you prefer using a stack over a queue?
-
When you need to process tasks in the order they arrive
-
When you need to backtrack through a series of operations
-
When you need to manage tasks with priority
-
When you need to store data persistently