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.
Divide and conquer:
- zhangdan January 15, 20151. for n numbers, partition them into two groups of size n/2 and n/2
2. find the max and min from each group
3. perform one more comparison to get the max of two group,
4. one more comparison to get the min of two group
Here's the complexity analysis:
1. Let T(n) be the complexity to get max and min for size n
2. T(n) = 2 T(n/2) + 2 (or T(n)+2 = 2 (T(n/2) + 2)
3. T(2) = 1, you only need one comparison to get max and min for group of 2
4. T(n) + 2 = n/2 * (T(1)+2) = 3n/2 => T(n) = 3n/2 + c
5. step 4 is rough because n may not be a power of 2 but you can use it to bound