In queue class definition, make use of the IsEmpty method in Show method

From TRCCompSci - AQA Computer Science
Revision as of 14:20, 24 May 2018 by Jared (talk | contribs)
Jump to: navigation, search

If I understand this correct it would be replace the condition within the if statement in Show, with !IsEmpty.

                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();
                }