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.
This problem is called 'Connect Component Labeling' in image processing and well defined by Steve Eddins through different techniques - "Google for his blog connected-component-labeling-part-4"
- D3minem October 25, 2012Two techniques which I liked easy to follow and implement quickly "Part4" and "Part6". Once you understand the basic idea of solving the problem, it wouldn't be hard to convert the algorithm in code.
Part4 - Algorithm implementation
a) Scan the matrix column-wise.
1b) Make a decision to scan 1's simultaneously while finding the neighbors for it OR
2b) First scan all 1's in the matrix and keep track of their indexes.
c) Now find the neighbors for each node based on technique either "4-connected" or "8-connected" in the original matrix and also mark 'revisited' for the selected node vertices (P.S: It will help us to identify the random starting point for next set in the original matrix).
d) Take a variable which keep track of connected sets in the original matrix, when u started marking the next available pairs of 1's.
Happy coding!