Martin McBride
Oct 24, 2023

Trees aren't obscure, of course, you would expect most software engineers to know what a tree is.

But I must admit it wasn't immediately obvious to me what inverting a tree means, and from some comments elsewhere about this story I don't think I am alone in that.

I wasn't aware of an algorithm to do it, although it is fairly obvious that you could traverse the tree depth first and swap the nodes as you come back up. But I would still look it up in case there is a better way to do it.

Martin McBride
Martin McBride

Responses (1)