Actually, I have this code for checking whether a queue is empty or not:-
bool Queue::empty()
{
return (myBack == myFront);
}
Is it wrong?
Also,
I don`t understand the use of the mod operator, what does it represent? I understand it solves a problem (that we can`t simply say...
So, my teacher comes to the lecture, writes the notes on the board... and then says: "from now on this part is intuitive"...
he means this part: (myFront != (myBack + 1) % max)
of the following (C++) code:-
void Queue::addQ (int x)
{
if (myFront != (myBack + 1) % max)
{
...
http://img710.imageshack.us/img710/2314/booleanalgebra.jpg
AFAIK logic is all about "T"/"F" or 0/1, and boolean algebra is all about logical manipulation.
But there seems to be something wrong since there is a boolean algebra with more that 2 objects in it`s set. So, can I have some...