https://ide.codingblocks.com/s/76044 showing run time error when input is odd number of values
Linked list mid point
Basically, when you have odd no of values, then both the slow and fast pointer will start from head only, thts why your code was giving runtime error,
I have made some modifications in your code, by using function getcount, which checks the no of values present in linked list, and based on tht will have slow and fast pointers based on whether input is even or odd.
Plz ask if u didnt understood the logic behind it.