Loading...
Engaged Employer
How to detect loop in a linked list
Anonymous
Two pointers
Traverse through each node till end , tracking visited node using visited flag. If you find node that is already visited, then there is a loop in LinkedList and if you reach till end while traversing then there is no loop in LinkedList
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.