Write a c program to check whether given link list is palindrome?  Each node of a linked list represents a number in it. From the below figure it is clear that the linked list 1->2->3->2->1 is a palindrome.

Check whether given link list is palindromeHow to check whether given link list is palindrome

There are various methods to check palindrome. The question is asked in the interview, so it is better to write less complexity based code. Lets discuss each method and its advantages.

(1) Recursive method: Time complexity O(n)

(2) Reverse the second half method:

 




Related Contents to follow