Beserk
BAN USER
Comments (4)
Reputation -5
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
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.
Taking all elements and sort it won't be a good way..
- Beserk February 04, 2013I am considering constructing a 'candidate pool' and adding and erasing elements to the pool in each step;
For example, for this array
1 4 8 12
5 9 18 21
7 15 19 23
The 1st smallest would be a[2][3], then construct a pool of [1,3] [2,2] for next step
The 2nd smallest is a[1][3](21) (we just choose from the pool construct from previous step);
Then erase [1,3] from pool, adding [0,3][1,2] to the pool, now the pool have [0,3] [1,2][2,2]
(You can notice that in this pool,[1,2], couldn't be a candidate since [2,2] is in the pool, probably we can filter it by using comparison before adding to pool.
Then repeat the previous steps until finding kth largest....
Probably works......