예제 #1
0
        public void AddStart()
        {
            SinglyLinkedList <int> list = new SinglyLinkedList <int>();

            list.AddStart(3);
            list.AddStart(2);
            list.AddStart(1);
            list.AddStart(0);

            int i = 0;

            foreach (var num in list)
            {
                Assert.True(num == i);
                i++;
            }

            Assert.True(list.Count == 4);
        }
예제 #2
0
        public void DankMemes(int[] array, int toAdd)
        {
            var test = new SinglyLinkedList <int>();

            for (int i = 0; i < array.Length; i++)
            {
                test.AddEnd(array[i]);
            }

            int length = test.Count;

            test.AddStart(toAdd);
            Assert.True(length != test.Count);
        }