sec queues /*queue adt *public interface queue /*reinitialize the queue the user is responsible for reclaiming the storage used by the queue elements *public void clear()/*place an element at the rear of the queue @param it the element being enqueued *public void enqueue( it)/*remove and return element at the front of the queue @return the element at the front of the queue *public dequeue()/*@return the front element *public frontvalue()/*@return the number of elements in the queue *public int length()figure the java adt for queue operationand removed from the front (called dequeue operationqueues operate like standing in line at movie theater ticket counter if nobody cheatsthen newcomers go to the back of the line the person at the front of the line is the next to be served thusqueues release their elements in order of arrival accountants have used queues since long before the existence of computers they call queue "fifolistwhich stands for "first-infirst-out figure shows sample queue adt this section presents two implementations for queuesthe array-based queue and the linked queue array-based queues the array-based queue is somewhat tricky to implement effectively simple conversion of the array-based list implementation is not efficient assume that there are elements in the queue by analogy to the array-based list implementationwe could require that all elements of the queue be stored in the first positions of the array if we choose the rear element of the queue to be in position then dequeue operations require only th( time because the front element of the queue (the one being removedis the last element in the array however in britaina line of people is called "queue,and getting into line to wait for service is called "queuing up