DEV Community

Discussion on: Loop detection - Google interview question

Collapse
 
rodiongork profile image
Rodion Gorkovenko

Thanks a lot! It never occurred to me that such question even has several named algorithms. Hare-and-Tortoise obviously couldn't be applied as is (because we have single function to call and it has some state) - but obviously it will fit in some modified version, especially if we allow restarting generator.

I'll send the link to your comment to my fellow, so thanks from him too, beforehand :)