Sollicitatievraag bij Cerebry (Singapore)

Detecting a loop in a linked list

Antwoord op sollicitatievraag

Anoniem

7 dec 2023

Detecting a loop in a linked list can be done using Floyd's Tortoise and Hare algorithm. It involves two pointers moving at different speeds; if they meet, there's a loop.