예제 #1
0
        /// <summary>
        /// Демонстрация работы DuplexLinkedDeque.
        /// </summary>
        public void DuplexLinkedDeque()
        {
            var duplexLinkedDeque = new DuplexLinkedDeque <int>();

            Console.WriteLine($"DuplexLinkedDeque - count: {duplexLinkedDeque.Count}");

            duplexLinkedDeque.EnqueueFront(111);
            duplexLinkedDeque.EnqueueFront(222);
            duplexLinkedDeque.EnqueueFront(333);
            duplexLinkedDeque.EnqueueBack(444);
            duplexLinkedDeque.EnqueueBack(555);

            Console.WriteLine($"DuplexLinkedDeque - count: {duplexLinkedDeque.Count}");

            Console.WriteLine($"DuplexLinkedDeque - dequeue front item: {duplexLinkedDeque.DequeueFront()}");
            Console.WriteLine($"DuplexLinkedDeque - dequeue back item: {duplexLinkedDeque.DequeueBack()}");
            Console.WriteLine($"DuplexLinkedDeque - dequeue front item: {duplexLinkedDeque.DequeueFront()}");
            Console.WriteLine($"DuplexLinkedDeque - dequeue back item: {duplexLinkedDeque.DequeueBack()}");

            Console.WriteLine($"DuplexLinkedDeque - count: {duplexLinkedDeque.Count}");
        }