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.
There are several approach to check whether link list is circular or not:-
- rajvivekgkv December 19, 20141st Approach :
Take a flag bit at each node and make it zero initially. While visiting each node make the flag bit as one if it is zero. If already flag bit found as one then loop exist that is circular list.
If somebody ask how we can take the flag bit at each node by own then you just give answer as while doing programming we always take some extra bit for future purpose.so we make it as flag bit. If they also not satisfied then just say i will take resize function to increase the size of node and then we use the flag bit. Time complexity= O(n).
2nd Approach :
Take an array. Store the 1st node next address and go to second node. while go to next node just check whether next address is already stored in array........and so on .Time complexity =O(square of n)
3rd approach:
start with two pointer from starting point of the list and increase 1st pointer by one and 2nd by two if the pointer meet on same point then the list is circular list else not.
Time complexity = O(n). This is the best algorithm. Its time complexity is asymptotically order of n but actually on an average it is n/2.