employer cover photo
employer logo
employer logo

Walmart Global Tech

Fait partie de Walmart

Employeur impliqué

Question d’entretien chez Walmart Global Tech

How will you find loop in linked list

Réponse à la question d'entretien

Utilisateur anonyme

11 oct. 2020

Traverse linked list using two pointers. Move one pointer(slow_p) by one and another pointer(fast_p) by two. If these pointers meet at the same node then there is a loop. If pointers do not meet then linked list doesn't have a loop.