Answer:
struct Node {
 int data;
 Node *next;
};
Node *reverse_list(Node *head) {
 if (head == nullptr || head->next == nullptr) {
 return head;
 }
 Node *new_head = reverse_list(head->next);
 head->next->next = head;
 head->next = nullptr;
 return new_head;
}
Step-by-step explanation:
The reverse_list function takes a pointer to the head of the list as input and returns a pointer to the new head of the reversed list. The function works as follows:
- If the list is empty or has only one node, then it returns the head, since the list is already reversed.
 - Otherwise, it calls itself recursively with the next node in the list.
 - After the recursive call returns, the current node's next pointer is updated to point to the previous node, effectively reversing the direction of the link.
 - Finally, the function returns the new head of the reversed list.