Segmentation fault in the code

My approach was to reverse the linked list and check each node in the original and reversed code.
However, it gives segmentation fault
Here is the link to my code:

Hey @prerna_gupta31
this approach wont work ,linked list is nodes with connection when u reverse it then that means u break the previous connections and make new ones . So reverse LL and original LL are still same, u havent crated a new LL .

So logic for this is
Find mid pt
break and reverse 2nd half
Match both 1st half and 2nd half.
(Make sure u take care of LL with odd length

Alright… I’ll implement the code for this approach

https://ide.codingblocks.com/s/364871 this approach also gives segmentation fault

Can you please help me find the error

Mentioned the changes in comments : https://ide.codingblocks.com/s/364872 :slight_smile: