Avoid if statements for checking neighboring indexes in a 2D array

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 17 00:14:26 PDT 2017


On Sunday, 16 July 2017 at 10:37:39 UTC, kerdemdemir wrote:
> My goal is to find connected components in a 2D array for 
> example finding connected '*'
> chars below.

You can also use a queue to avoid recursion that should improve 
performances and readibility.

Probably using ndslice library could help you!

Andrea


More information about the Digitalmars-d-learn mailing list