Animesh SinhaBAN USER
Traverse till the middle of the linked list and then reverse the linked list from the middle to the end inplace. After that, just compare the elements from the head and the middle.
Time Complexity = O(n)
Space Complexity = O(1)
isn't this wrong?
if u give input = 314, then according to u, F(0) = 1, F(1) = 1 , F(2) = 1, whereas F(2) will be 2.
is not writing a return statement at the end a reason for the error because the main function is defined as "int" ?
You don't have the parent pointers. How will you apply BFS ?- Animesh Sinha September 10, 2013