Difference between revisions of "In queue class definition, make use of the IsEmpty method in Show method"
m |
m (Hopefully fixed my failed attempt at speaking the English language) |
||
Line 1: | Line 1: | ||
− | If I understand this | + | If I understand this correctly it would be replace the condition within the if statement in Show, with !IsEmpty. |
<syntaxhighlight lang="C#"> | <syntaxhighlight lang="C#"> |
Revision as of 15:22, 24 May 2018
If I understand this correctly it would be replace the condition within the if statement in Show, with !IsEmpty.
public void Show(){
if (!IsEmpty())//This has changed from Rear != -1
{
Console.WriteLine();
Console.Write("The contents of the queue are: ");
foreach (var item in Contents)
{
Console.Write(item);
}
Console.WriteLine();
}
}