Beispiel #1
0
        public void Tests(int[] input, int startNode, int endNode, int[] expectedOutput)
        {
            LinkedList <int> list     = new LinkedList <int>(input);
            LinkedList <int> expected = new LinkedList <int>(expectedOutput);

            C07Q02.ReverseSublist(list, startNode, endNode);
            Assert.True(LinkedList <int> .AreValuesEqual(expected, list));
        }
Beispiel #2
0
        public void Example()
        {
            LinkedList <int> list     = new LinkedList <int>(new int[] { 11, 3, 5, 7, 2 });
            LinkedList <int> expected = new LinkedList <int>(new int[] { 11, 7, 5, 3, 2 });

            C07Q02.ReverseSublist(list, 2, 4);
            Assert.True(LinkedList <int> .AreValuesEqual(expected, list));
        }