queues qlist queue (pylistfigure an instance of the queue adt implemented using python list element of the list before attempting to remove an item from the listwe must ensure the queue is not empty rememberthe queue definition prohibits the use of the dequeue(operation on an empty queue thusto enforce thiswe must first assert the queue is not empty and raise an exceptionwhen the operation is attempted on an empty queue since we use list operations to implement the individual queue operationswe need only recall the worst case times for the python list operations the size and empty condition operations only require ( time the enqueue operation requires (ntime in the worst case since the list may need to expand to accommodate the new item when used in sequencethe enqueue operation has an amortized cost of ( the dequeue operation also requires (ntime since the underlying array used to implement the python list may need to shrink when an item is removed in additionwhen an item is removed from the front of the listthe following items have to be shifted forwardwhich requires linear time no matter if an expansion occurs or not using circular array the list-based implementation of the queue adt is easy to implementbut it requires linear time for the enqueue and dequeue operations we can improve these times using an array structure and treating it as circular array circular array is simply an array viewed as circle instead of line an example is illustrated in figure figure the abstract view of circular array (leftand the physical view (righta circular array allows us to add new items to queue and remove existing ones without having to shift items in the process unfortunatelythis approach introduces the concept of maximum-capacity queue that can become full circular array queue implementation is typically used with applications that only require small-capacity queues and allows for the specification of maximum size