queue operation queue contents return value is_empty( enqueue( enqueue('dog' enqueue(trueq size( is_empty( enqueue( dequeue( dequeue( size([[ ['dog', [true,'dog', [true,'dog', [true,'dog', [ ,true,'dog', [ ,true,'dog'[ ,true[ ,truetrue false 'dog table example queue operations the queue abstract data type the queue abstract data type is defined by the following structure and operations queue is structuredas described aboveas an ordered collection of items which are added at one endcalled the "rear,and removed from the other endcalled the "front queues maintain fifo ordering property the queue operations are given below queue(creates new queue that is empty it needs no parameters and returns an empty queue enqueue(itemadds new item to the rear of the queue it needs the item and returns nothing dequeue(removes the front item from the queue it needs no parameters and returns the item the queue is modified is_empty(tests to see whether the queue is empty it needs no parameters and returns boolean value size(returns the number of items in the queue it needs no parameters and returns an integer as an exampleif we assume that is queue that has been created and is currently emptythen table shows the results of sequence of queue operations the queue contents are shown such that the front is on the right was the first item enqueued so it is the first item returned by dequeue implementing queue in python it is again appropriate to create new class for the implementation of the abstract data type queue as beforewe will use the power and simplicity of the list collection to build the internal representation of the queue we need to decide which end of the list to use as the rear and which to use as the front the implementation shown below assumes that the rear is at position in the list this allows us to use the insert function on lists to add new elements to the rear of the queue the pop operation queues