Пример #1
0
        public void IsTailGoodFirst()
        {
            var list = new DoublyCircularlyLinkedList.LinkedList <int>();

            list.AddFirst(16);
            list.AddFirst(14);
            Assert.Equal(16, list.Tail.value);
        }
Пример #2
0
        public void AddAfterTest()
        {
            var list = new DoublyCircularlyLinkedList.LinkedList <int>();

            list.AddFirst(16);
            list.AddLast(14);
            list.AddAfter(7348, 0);
            Assert.Equal(7348, list.Head.next.value);
        }
Пример #3
0
        public void RemoveFirstTest()
        {
            var list = new DoublyCircularlyLinkedList.LinkedList <int>();

            list.AddFirst(0);
            list.AddAfter(1, 0);
            list.AddAfter(2, 1);
            list.AddAfter(3, 2);
            list.RemoveFirst();
            Assert.Equal(1, list.Head.value);
        }
Пример #4
0
        public void AddBeforeTest()
        {
            var list = new DoublyCircularlyLinkedList.LinkedList <int>();

            list.AddFirst(16);
            list.AddLast(15);
            list.AddLast(14);
            list.AddLast(13);
            list.AddLast(12);
            list.AddLast(11);
            list.AddLast(10);
            list.AddLast(9);
            list.AddLast(8);
            list.AddLast(7);
            list.AddLast(6);
            list.AddLast(5);
            list.AddBefore(4, 4);
            Assert.Equal(4, list.Head.next.next.next.next.value);
        }