ProAnswers.org

algorithm Check if the Queue is empty

algorithm Check if the Queue is empty

Checking if a queue is empty

int isEmpty(queue *q){
    if(q -> front == q -> rear) //Queue is Empty
        return 1;
    else
        return 0;
}