Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DemoQueue3
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Demo Queue - versión genérica - Caso Ejemplo b)");
- SpecialQueue<int> queue1 = new SpecialQueue<int>();
- Random random = new Random();
- int number;
- Console.WriteLine("Enqueuing...");
- for (int c = 0; c < 10; ++c)
- {
- queue1.Enqueue(number = random.Next(1, 11));
- Console.Write("{0} ", number);
- }
- Console.WriteLine();
- Console.WriteLine("Joining with same queue...");
- SpecialQueue<int> queue2 = queue1.join(queue1);
- Console.WriteLine("Dequeuing...");
- while (queue1.Count > 0)
- {
- Console.Write("{0} ", queue1.Dequeue());
- }
- Console.WriteLine();
- Console.WriteLine("Dequeuing joined queue...");
- while (queue2.Count > 0)
- {
- Console.Write("{0} ", queue2.Dequeue());
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement