Standard Queue Functions
def isEmpty ( queue ) : NEW_LINE INDENT return queue . front == - 1 NEW_LINE DEDENT def isFull ( queue ) : NEW_LINE INDENT return queue . rear == queue . size - 1 ; NEW_LINE DEDENT def hasOnlyOneItem ( queue ) : NEW_LINE INDENT return queue . front == queue . rear ; NEW_LINE DEDENT def Enqueue ( root ) : NEW_LINE INDENT if ( isFull ( queue ) ) : NEW_LINE INDENT return ; NEW_LINE DEDENT queue . rear += 1 NEW_LINE queue . array [ queue . rear ] = root ; NEW_LINE if ( isEmpty ( queue ) ) : NEW_LINE INDENT queue . front += 1 ; NEW_LINE DEDENT DEDENT def Dequeue ( ) : NEW_LINE INDENT if ( isEmpty ( queue ) ) : NEW_LINE INDENT return None ; NEW_LINE DEDENT temp = queue . array [ queue . front ] ; NEW_LINE if ( hasOnlyOneItem ( queue ) ) : NEW_LINE INDENT queue . front = queue . rear = - 1 ; NEW_LINE DEDENT else : NEW_LINE INDENT queue . front += 1 NEW_LINE DEDENT return temp ; NEW_LINE DEDENT def getFront ( queue ) : NEW_LINE INDENT return queue . array [ queue . front ] ; NEW_LINE DEDENT