http://www.gild.com/challenges/details/295
No of connected components, use BFS/DFS On Sun, Dec 4, 2011 at 9:12 PM, rajesh ko <[email protected]> wrote: > We have given a black and white image and a fill tool that turn an > area of black pixel into white pixels. Fill tool works like a 8-way > floodfill tool.So it will turn each black pixel to a white pixel > untill there isn't a blackpixel that can be reached from the previous > pixel. (8 ways -> north,east,west,south and four corners). > > Q : Given a black and white image of dimension x*y , Determine how > many time we have to apply fill tool to turn the whole image into a > white one. For simplicity consider an image is a matrix of size x*y. > in example 1-> white pixel and 0-> black pixel. > > eg: > i/p: > > 3 5 > > 10111 > 10100 > 00111 > > o/p: > > 2 > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Sunny Aggrawal B.Tech. V year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
