TechSmith

  www.techsmith.com
  www.techsmith.com

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?
Tags:
data structures, programming
Answer

Interview Answer

3 Answers

0

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
0

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
0

http://ostermiller.org/find_loop_singly_linked_list.html

Chauhan on Feb 11, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.