what is the time complexity of implementing dequeue() of queue using array? Assuming that we are using a circular queue.
If we are using a circular queue, then we will be maintaining a front and rear pointer to know which index is holding front element and rear element. so if we remove front element, then we will change only front pointer, we don't need to move rest of the elements, so it can be done in O(1) complexity.
Back To Top