Reverse linked list using recursion Here is my code to reverse link list in using recursion:

       Node n = null;

    private void ReverseList(Node temp)
    {
        if (temp == null)
            return;

        ReverseList(temp.nextNode);

        Node newNode = temp;
        newNode.nextNode = null;
        if (n == null)
        {
            n = newNode;
        }
        else
        {

            Node TempNode = n;

            while (TempNode.nextNode != null)
            {
                TempNode = TempNode.nextNode;
            }
            TempNode.nextNode = newNode;
             head=n;
        }

    }


Is this the preferred way of doing this? What modifications can I make to optimize this code?
Do use descriptive name for the variables and parameters, all those n, temp, newNode do not tell anything.

Reversing the list using recursion should not rely on 'external' variables as you do with Node n = null;. Given that linked list after reversal should have the last element at its head, I would suggest to pass it through the recursive chain hierarchy as a return value.

Having a loop while (TempNode.nextNode != null) makes recursion useless, as you walk through the list via loops instead of recursion. Try to come up with the approach where you do not need loops to get the head of the resulting linked list.