
Last chance! 50% off unlimited learning
Sale ends in
If the location and its neighbors, not including itself, are connected, then return the set containing the location and its neighbors; otherwise, return the empty set
if_connected(distinct_neighbors, location, adjacency_matrix)
A set
of the given location and the neighbors if they are
connected, else returns the empty set.
A set
containing the neighboring locations
to the given location, not including the location itself.
A location, preferably given as an integer.
A boolean matrix, with element