Standard Queue Functions
int isEmpty ( Queue * queue ) { return queue -> front == -1 ; } int isFull ( Queue * queue ) { return queue -> rear == queue -> size - 1 ; } int hasOnlyOneItem ( Queue * queue ) { return queue -> front == queue -> rear ; } void Enqueue ( node * root , Queue * queue ) { if ( isFull ( queue ) ) return ; queue -> array [ ++ queue -> rear ] = root ; if ( isEmpty ( queue ) ) ++ queue -> front ; } node * Dequeue ( Queue * queue ) { if ( isEmpty ( queue ) ) return NULL ; node * temp = queue -> array [ queue -> front ] ; if ( hasOnlyOneItem ( queue ) ) queue -> front = queue -> rear = -1 ; else ++ queue -> front ; return temp ; } node * getFront ( Queue * queue ) { return queue -> array [ queue -> front ] ; }