Citrix System Inc Interview Question
Software Engineer / DevelopersI think it will take equal number of iterations as before. This is because it will converge after n iterations.
Correct me if i am wrong
I think it will take equal number of iterations as before. This is because it will converge after n iterations.
Correct me if i am wrong
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
The standerd algo is using fast & slow pointers. Fast one incremented by 2 & slow one by 1. We check whether they meet. Now, in a list having cycles we have linear nodes followed by the loop. Fast pointer reach the loop first. When slow pointer reachs the loop say the fast pointer is n nodes ahead in the loop. In every iteration from then this distance reduces by 1. So after n iterations they meet & we find the loop.
- um December 25, 2010If fast ptr is incremented by 3 & slow ptr by 2, we still get the correct result since after both ptr reach the loop the distance betwwen them reduces by 1 in every iteration. However this is less efficient then the first one, since more increments are done to get the same result.