Exemplo n.º 1
0
 /// <summary>
 /// Prints pseudoqueue to console
 /// </summary>
 public void Print()
 {
     Offload(Backend, Frontend);
     Console.Write("Rear => ");
     try
     {
         while (Frontend.Top != null)
         {
             Console.Write($"{Frontend.Top.Value} => ");
             Backend.Push(Frontend.Pop().Value);
         }
     }
     catch (NullReferenceException)
     {
         Console.Write(" (no nodes to print) => ");
     }
     finally
     {
         Console.WriteLine("Front");
     }
 }