TechSmith Interview Question: Given a singly linked list, h... | Glassdoor

Interview Question

Software Engineer Intern Interview(Student Candidate) Okemos, MI

Given a singly linked list, how can you find if there is a

  loop in the list?
data structures, programming

Interview Answer

3 Answers


I came up with an O(N^2) method, but he told me there is a simpler O(N) method. (Look it up if you are interested)

Interview Candidate on Oct 13, 2010

if you get back to the starting node after reversing the list, that means there is a loop in the list.

anonymouse on Mar 11, 2011

Chauhan on Feb 11, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.