Question: What is the time complexity of implementing a queue using two stacks?
Options:
Correct Answer: O(1) for enqueue, O(n) for dequeue
Solution:
Implementing a queue using two stacks allows O(1) time for enqueue and O(n) time for dequeue, as elements may need to be transferred between stacks.