The Tortoise and the Hare in Alloy

from blog Surfing Complexity, | ↗ original
If you’ve done your share of leetcode-style interviewing, and you’re above a certain age, you may have been asked during a technical screen to write a program that determines if a linked list contains a cycle. If the interviewer was really tough on you, they might have asked how to implement this in O(1) space. … Continue reading The Tortoise and...