Tuesday, December 26, 2017

Count the connected components in a matrix

Dec. 26, 2017

Introduction


It is the good idea to write a recursive function to complete the algorithm in less than 10 minutes. I could not do it. My last practice took me near 20 minutes or so.

Here is my last practice at 10:00 PM on Dec. 24, 2017.

Today I had a mock interview at 6 PM, and then the peer wrote a C# version as well. I will write one using similar idea, to check recursive for left/ top/ right/ bottom four neighbors if the range is ok and also the value is 1.





No comments:

Post a Comment