Пример #1
0
        public static void Main(string[] args)
        {
            DoublyLinkedList doublyLinkedList = new DoublyLinkedList();

            doublyLinkedList.AddFirst(1);
            doublyLinkedList.AddFirst(2);
            doublyLinkedList.AddFirst(3);
            doublyLinkedList.Print(Console.WriteLine);
        }
Пример #2
0
        public static void Main()
        {
            var doublyLinkedList = new DoublyLinkedList();

            doublyLinkedList.AddFirst(1);
            doublyLinkedList.AddFirst(2);
            doublyLinkedList.AddFirst(3);

            doublyLinkedList.Print(Console.WriteLine);
            Console.WriteLine(doublyLinkedList.Count == 3);
        }
Пример #3
0
        public static void Main()
        {
            var doublyLinkedList = new DoublyLinkedList();

            doublyLinkedList.AddFirst(1);
            doublyLinkedList.AddFirst(2);
            doublyLinkedList.AddFirst(3);
            doublyLinkedList.AddLast(4);
            doublyLinkedList.AddLast(5);
            doublyLinkedList.AddLast(6);

            doublyLinkedList.RemoveFirst();
            doublyLinkedList.RemoveLast();

            doublyLinkedList.ForEach(Console.WriteLine);
        }