for this question imo we can do something like gnome sort/ sorting by reversal like for example we have this linked list 1 -> 2 -> 3 -> 4 so i start with 1 and change its head pointers head to 1 like so in this way the subsequent steps would look something like this 2 -> 1 -> 3 -> 4, 2 -> 3 -> 1 -> 4, 2 -> 3 -> 4 -> 1.
This way we can achieve reversal of a singly linked list using n(n-1)/2 pointer reassignments, because at each position we are doing i operation where i is the index from 1 to n