Question: If a queue is implemented using two stacks, what is the time complexity of dequeue operation in the worst case?
Options:
Correct Answer: O(n)
Solution:
In the worst case, the dequeue operation can take O(n) time because all elements may need to be transferred from one stack to another.