I have a simple Tile-Class, which has the property IsBlack. I'm working with a two-dimensional array (Tile[,]).
I'd like to check whether all white fields (those where IsBlack=false) are connected. Following examples would return true:

Whereas following would return false:

I have a number of ideas, though I think they are rather inefficient:
If steps 3 finds an unvisited white, then return false, otherwise return true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With