In an array based queue with constant size if instead of cha

In an array based queue with constant size, if instead of changing the value of head and tail, a modulus of the size of the array was used instead, what boundary condition could eventually be reached?

Solution

In the given question there is a constraint that we can\'t change the values of head and tail and instead of this we are considering modulus of the size of array -

As per given condition boundary conditions are-

1-if you considering this as an simple queue-

and if

size[array]%sizeof[no. of elements in the array] ==tail then queue is empty.

In an array based queue with constant size, if instead of changing the value of head and tail, a modulus of the size of the array was used instead, what boundar

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site