What is the time complexity of adding an element to the queue (enqueue…
2025
What is the time complexity of adding an element to the queue (enqueue operation)?
- A.
O(1)
- B.
O(n)
- C.
O(n log n)
- D.
O(n^2)
Attempted by 439 students.
Show answer & explanation
Correct answer: A
The time complexity of enqueue operation (adding an element to the end of the queue) is O(1) as it only takes a constant amount of time.