[F=front, R=rear, P= pointer, q[] is the array variable] Algorithm: if F != R F = P count = 0 while(P <= R) { count = count + 1; P = P+1; } //Display count which shows number of elements in queue.
Above answer was rated as good by the following members: Rizwan Saeed Shaikh
[F front R rear P pointer q[] is the array variable] Algorithm: if F ! R F P count 0 while(P < R) { count count + 1; P P+1; } //Display count which shows number of elements in queue.
[F front R rear P pointer q[] is the array variable] Algorithm: if F ! R P F count 0 while(P < R) { count count + 1; P P+1; } //Display count which shows number of element