For no reason in particular I decided to revisit tree traversal as a kind of programming kata. There are two main kinds of tree traversal:
- Depth first – This is where you go all the way down a tree’s branches first before bubbling up to do work.
I was recently asked to write some code to find the largest contiguous group of synonymous elements in a two dimensional array. The idea is that you want to find the largest “land mass” in a problem where you have a game board that looks something like
L stands for land, and
W stands for water.… Read the rest