Use two pointers, one 5 elements ahead of the other. Now move both
pointers ahead together by one element until the first one hits the
end, the second pointer will point to the fifth element from the last.

Reply via email to