Question DSA-QUE-0014
MediumWhat is the time complexity of enqueue and dequeue in a queue implemented with a linked list (with head and tail pointers)?
- A.
O(1) for both
- B.
O(n) for both
- C.
O(1) enqueue, O(n) dequeue
- D.
O(log n) for both
Sign up free to see the answer and a step-by-step explanation.