Yaa this will work , you need to handle the case for odd number of
nodes .
For even number of node it will serve the purpose .

Yaa for the second part also you can use the ratio concept

fast pointer : slow pointer = 4:3

slow = ptr->next->next->next
fast = ptr->next->next->next->next


Here also we need to handle the case if the number of node is not a
multiple of 4 .

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to