Re:Tree traversal without recursion: the tree as a state mac...
by Hitton on Tuesday September 03, 2019 @04:41AM
(#20864691)
Honestly I'm quite surprised that although this uses both Perl and goto it gets upvoted. Sometimes I'm pleasantly surprised by HN community.
[ Parent
| on HN ]
Re:Tree traversal without recursion: the tree as a state mac...
by lioeters on Tuesday September 03, 2019 @01:33PM
(#20868928)
The goto's did get my nerves bristling a bit on first sight - but it's the right tool for the job (or at least gets the job done), so I was OK with it. I guess other languages may have better/cleaner ways to achieve it.
I love the discussion that it sparked here too. It's wonderful and educational to see so many smart people breaking down the problem space, discussing de/merits of this particular technique, presenting alternative approaches with analysis on memory use, performance..