Approach for connected components?

Hi All,

What approach do you guys take while attempting to solve connected components type of problems given some input matrix.
For example : https://leetcode.com/problems/number-of-islands/
Will really appreciate coming up with some strategic approach to such problems.

TIA

Comments (2)