예제 #1
0
 static void Main(string[] args)
 {
     Dequeue<string> some = new Dequeue<string>();
     some.AddToFront("aa");
     some.AddToFront("bb");
     some.AddToFront("cc");
     Console.WriteLine(some.PeekFromEnd());
     Console.WriteLine(some.PeekFromFront());
 }
예제 #2
0
        static void Main(string[] args)
        {
            Dequeue<string> queue = new Dequeue<string>();
            queue.AddToEnd("one");
            queue.AddToEnd("two");
            queue.AddToEnd("three");
            queue.AddToFront("zero");

            Console.WriteLine(queue.PeekFromFront());
            Console.WriteLine(queue.PeekFromEnd());
            if (queue.Contains("one"))
            {
                Console.WriteLine(true);
            }
        }