What would be a good algorithm for searching through 2D arrays of data and creating borders around data of the same sort? The data would be random so there wouldn't be any prior knowledge of the data available, other than that it'd contain numeric values.
Otherwise are there any good articles/books on the subject?
Edit
Here is an example of what I'm trying to achieve:

And the same for the two's
Breadth First Search could help you here.First construct the graph G as follows:
Graph G has edge (u,v) is and only if value of u-th cell=value of v-th cell.
Then carrying out BFS gives nice pieces of the graph that you can conveniently mark as visited using the value of the cell.
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