Question: What is the time complexity of reversing a queue using a stack?
Options:
Correct Answer: O(n)
Solution:
Reversing a queue using a stack involves transferring all elements to the stack and then back to the queue, resulting in a time complexity of O(n).