Jul 112012
 

Write a function which will accept a pointer to the head of the linked list and returns a pointer to the middle node of the list. If the list given is

2 -> 3 -> 5 -> 1 -> 4 -> 8 -> 10

Then the function should return a pointer to Node with value 1. If the list has even number of elements

2 -> 3 -> 5 -> 1 -> 4 -> 8

Then you may return a pointer to either 5 or 1 (Since there is no clear middle node).
Continue reading »