find if two islands are connected: assumes that you have a, b, c, d, e, f all respresenting islands and you recieve a map of Islands and the island next to it (a,b), (b,c), (c,d) and (e,f). There's a way from a to d so your method will return true as a,d is connected through b,c but there's no way from d to f. write a method to return true if two islands are connected and false if now.
Solution: imagine this as a graph problem and implement an adjecency list then traverse using BFS to tell if two islands are connected or not.