Reversing a Linked List in Place

To reverse a linked list in place, we need to keep track of the current node, as well as the previous and next nodes. We can then change the pointers of the current node to point to the previous node, and move on to the next node.

Problem

Given a linked list, reverse the list in place (i.e. without creating a new list).
Example input:
1->2->3->4->5
Example output:
5->4->3->2->1

Solution

This solution is in C#. Our A.I. can create solutions in multiple languages.
by kayakane
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InterviewPreperationGuide.Core.CrackingTheCodingInterview.c2q3 {
    public class Solution {
        public void Init () {
            Console.WriteLine ();
        }
    }
}

A.I. Evaluation of the Solution

The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.

Evaluated at: 2022-11-26 10:15:52