Suggest an editImprove this articleRefine the answer for “What is the time complexity of inserting into a queue?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Enqueue (insertion into a queue)** usually has a time complexity of **O(1)**, meaning it runs in constant time because the element is simply added to the end of the queue without traversing the whole list. **Key point:** the exception is resizing a fixed-size array, which can take O(n), though in the amortized sense the complexity stays O(1).Shown above the full answer for quick recall.Answer (EN)ImageThe time complexity of the **enqueue (insertion into a queue)** operation is usually **O(1)**, meaning it runs in constant time. This is because the element is simply added to the end of the queue, without needing to traverse the whole list. > Exception: if the queue is implemented on a fixed-size array and it needs to be resized, then at the moment of memory reallocation the operation can take **O(n)**, but this happens rarely (in the amortized sense, the complexity stays O(1)).For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.