The Tortoise and the Hare algorithm