Linked list palindrome check

why am i getting run time error ??
in my code i have created a doubly LL and prev points to previous node while next points to next node
my code
https://ide.codingblocks.com/s/43547

qn link
https://hack.codingblocks.com/contests/c/511/313

5
1 2 3 5 1 1

https://ide.codingblocks.com/s/43592

I have corrected and commented the mistake.

bhaiya
https://ide.codingblocks.com/s/43673
i am not able to make the insert function as a member function of node class i.e declaring that function inside class node{
please help

https://ide.codingblocks.com/s/43811

I have commented the mistake.