shrinking the underlying array desirable property of queue implementation is to have its space usage be th(nwhere is the current number of elements in the queue our arrayqueue implementationas given in code fragments and does not have this property it expands the underlying array when enqueue is called with the queue at full capacitybut the dequeue implementation never shrinks the underlying array as consequencethe capacity of the underlying array is proportional to the maximum number of elements that have ever been stored in the queuenot the current number of elements we discussed this very issue on page in the context of dynamic arraysand in subsequent exercises - through - of that robust approach is to reduce the array to half of its current sizewhenever the number of elements stored in it falls below one fourth of its capacity we can implement this strategy by adding the following two lines of code in our dequeue methodjust after reducing self size at line of code fragment to reflect the loss of an element if self size len(self data/ self resize(len(self data/ analyzing the array-based queue implementation table describes the performance of our array-based implementation of the queue adtassuming the improvement described above for occasionally shrinking the size of the array with the exception of the resize utilityall of the methods rely on constant number of statements involving arithmetic operationscomparisonsand assignments thereforeeach method runs in worst-case ( timeexcept for enqueue and dequeuewhich have amortized bounds of ( timefor reasons similar to those given in section operation enqueue(eq dequeueq firstq is emptylen(qamortized running time ( ) ( ) ( ( ( table performance of an array-based implementation of queue the bounds for enqueue and dequeue are amortized due to the resizing of the array the space usage is ( )where is the current number of elements in the queue