Interview Question

Software Engineer Interview(Student Candidate) New York, NY

How would you find a loop in a linked-list

Tags:
algorithm
Answer

Interview Answer

1 Answer

1

Slow and fast runners (i.e. one pointer incrementing one position, another incrementing two positions on every iteration). If they meet, there's a loop

Interview Candidate on Nov 11, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.