List rooted trees: Difference between revisions

m
m (J: use that for both results from (boxed))
Line 286:
└─────┴──────┴──────┴───────┴───────┴──────┴───────┴───────┴────────┘</pre>
 
Explanation: we are using the [[Tree_traversal#J:_Alternate_implementation|parent index]] representation of a tree. The tree is represented as a sequence of indices of the parent nodes. And we use _ to represent the root node (so our root node has no parent). In the result here, each square box represents a bag.
 
<code>incr</code> adds each possible child to each node of each tree and forms the result into a simple list of trees.
6,962

edits