def first(self)"""return (but do not removethe element at the front of the queue raise empty exception if the queue is empty ""if self is empty)raise emptyqueue is empty head self tail next return head element def dequeue(self)"""remove and return the first element of the queue ( fiforaise empty exception if the queue is empty ""if self is empty)raise emptyqueue is empty oldhead self tail next removing only element if self size = queue becomes empty self tail none elsebypass the old head self tail next oldhead next self size - return oldhead element def enqueue(selfe)"""add an element to the back of queue ""node will be new tail node newest self node(enoneif self is empty)initialize circularly newest next newest elsenew node points to head newest next self tail next old tail points to new node self tail next newest new node becomes the tail self tail newest self size + def rotate(self)"""rotate front element to the back of the queue ""if self size self tail self tail next old head becomes new tail code fragment implementation of circularqueue classusing circularly linked list as storage (continued from code fragment