What is the time complexity for the operations Enqueue() and Dequeue() in a Queue<T>?
Follow:
- Enqueue() → O(1) average case
- Dequeue() → O(1) average case
Due to the internal circular array and pointer arithmetic, both operations are highly efficient
unless resizing is needed (which is O(n), but infrequent).