Is it possible to implement a circular queue by use of an array, without having a counter to count the number of items in the queue or without wasting any entry of the array ?
What I guess :
It's not possible , let's assume that we have two pointers front and rear, the first one points to the first element of the queue ,
we can define the rear pointer in two ways :
1.It points to the last element which was inserted into the queue , so the next entry is the possible place for the next element which will be inserted
2.It points to the place where the next element is going to be inserted
In either case we cannot distinguish between full & empty queue if we don't waste at least one entry of the array or if we don't keep a counter counting the number of inserted - number of deleted elements