Difference between revisions of "IsEmpty"
Line 13: | Line 13: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | This section of code checks to see if the last position in the queue is empty, to determine if the queue is full or not, and thus whether more data can be added. If the position is free, the method returns true. If it is not free, the method returns false. |
Latest revision as of 13:31, 14 November 2017
public bool IsEmpty()
{
if (this.Rear == -1)
{
return true;
}
else
{
return false;
}
}
This section of code checks to see if the last position in the queue is empty, to determine if the queue is full or not, and thus whether more data can be added. If the position is free, the method returns true. If it is not free, the method returns false.