Mark As Completed Discussion

Let's test your knowledge. Click the correct answer from the options.

What is the time complexity of both the enqueue and dequeue operations in a queue implemented using stacks?

Click the option that best answers the question.

  • O(1)
  • O(n)
  • O(log n)
  • O(n^2)