public void _2_6_IsPalindrome_WithLinkedList121_ShouldReturnTrue()
        {
            Node input = TestLinkedLists._121();

            bool result = _practice.IsPalindrome(input);

            Assert.AreEqual(true, result);
        }
        public void _2_2_KthToLastIterative_Test5()
        {
            int expected = 1;

            Node inputList = TestLinkedLists._12345();
            Node actual    = _practice.KthToLastIterative(inputList, 4);

            Assert.AreEqual(expected, actual.Data);
        }
Пример #3
0
        public void _2_4_Partition_With3_5_8_5_10_2LinkedList_ShouldCreatePartitioned()
        {
            Node testList = TestLinkedLists._3_5_8_5_10_2();
            Node expected = TestLinkedLists._3_2_1_5_8_5_10();

            Node partitionedList = _practice.Partition(testList, 5);

            partitionedList.Should().BeEquivalentTo(expected);
        }
        public void _2_1_RemoveDupsIterative_Test2()
        {
            Node expected = TestLinkedLists._123();

            Node input  = TestLinkedLists._11122233();
            Node actual = _practice.Problem_2_1_Iterative(input);

            Assert.AreEqual(true, LinkedListUtilityMethods.AreLinkedListsEqual(actual, expected));
        }
        public void _2_1_RemoveDupsRecursive_Test1()
        {
            Node expected = TestLinkedLists._12345();

            Node input  = TestLinkedLists._1234555();
            Node actual = _practice.Problem_2_1_Recursive(input);

            Assert.AreEqual(true, LinkedListUtilityMethods.AreLinkedListsEqual(actual, expected));
        }