First of all I found recursive version of reversing singly linked list better than iterative version of SLL.
1) In iterative version we just reverse the link of each node, not exchange the value
2) In recursive version we go end of linked list and print that value and go to prev call , print the value. Again prev call like that
Now, for palindrome there will be two cases
i) Odd length palindrome
ii) Even length palindrome
i)In Odd length palindrome take 2 pointers p and q
p and q both points to the node which head points
Now, each iteration of while loop increment p like p->next->next and q increment like q->next
until we get p->next=NULL
When p->next=NULL
take another pointer new and assign new =q->next->next
Now break the list from new pointer and reverse it from new pointer to the end of list
Means if a list
1->2->3->4->3->2->1
new will point in 3 of list 3->2->1 and reversing we will get 1->2->3
Now, compare 1st list with 2nd list
ii)For even linked list same thing will happen, p and q pointer will increment in same manner, just go until p!=NULL(not p->next!=NULL)