Ad
  • Default User Avatar

    That is the point of the kata, to reverse the list without touching the values. Only the pointers are modified. If that is not clear in the description, perhaps the description should be updated instead?

  • Default User Avatar

    The test case has to be modified to check by value and not by reference.

        assertEquals(newHead.value, node3.value);
        assertEquals(node3.next.value, node2.value);
        assertEquals(node2.next.value, node1.value);
        assertEquals(node1.next, null);
    

    Currently the test case is checking whether two node variables are referring to same object. Instead of checking whether the two
    node variables have same value.

    The reverse method will return a new matching list it doesn't reverse the passed in list.

    Please fix the test case. I am not be submit the solution because of wrong test case

  • Default User Avatar

    I didn't understand the kata description. Please improve the description.