Re: [algogeeks] Re: Find the number of islands/connected components

2013-04-11 Thread Arpit Sood
islands are five as for each cell we assume all surrounding positions to be connected... so if coordinates are (x,y) then it is connected to (x+1, y), (x-1, y), (x+1, y+1), (x-1, y+1), (x+1, y-1), (x-1, y-1), (x, y-1), (x, y+1) On Thu, Apr 11, 2013 at 9:35 AM, rahul sharma

[algogeeks] Re: Find the number of islands/connected components

2013-04-11 Thread rahul sharma
M not getting matrix..is it adjacencyif simple 1 means connected components then first wehave 3 ones..then in second line 3 ones form 1 more island..hw in last row 3 islands are formed..these are 3 1 means three independent nodes...m I ryt? On Thursday, April 11, 2013, Arpit Sood