[Jprogramming] varying path length relation to tree

Raoul Schorer raoul.schorer at gmail.com
Sat Sep 19 15:50:55 UTC 2020


Dear all,

I am attempting to recover trees from a varying length path encoding. Chapter
32: Trees <https://www.jsoftware.com/help/learning/32.htm> shows how to do
it for fixed-length paths, but I wasn't able to find a suitable solution to
the varying length case. To illustrate:

leaves =. 'g';1
paths =. (,0);1 0
tree =. paths mktree leaves
tree -: 'g';<<1
1

What would be the definition of 'mktree'? Is there a "common idiom" APL
solution to that?

Thanks a bunch,
Raoul


More information about the Programming mailing list