Suggest an editImprove this articleRefine the answer for “What is the time complexity of removing from a queue?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Dequeue (removal from a queue)** has a time complexity of **O(1)**, because the element is always removed from the front of the queue and it is enough to move a pointer, without traversing the whole list. **Key point:** if the queue is implemented on a plain array without a circular structure and elements are physically shifted, the complexity becomes O(n), which is why circular buffers or linked lists are used in practice.Shown above the full answer for quick recall.Answer (EN)ImageThe time complexity of the **dequeue (removal from a queue)** operation is **O(1)**. This is because the element is always removed **from the front of the queue**, and this does not require traversing the whole list: it is enough to just move a pointer (or take the first element, if the queue is implemented as a linked list or a circular buffer). > Exception: if the queue is implemented on a plain array without a circular structure and elements are physically shifted on removal, then the complexity becomes **O(n)**. That is why circular buffers or linked lists are used in practice to keep **O(1)**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.