There is a tree:
- Each row is a path
parent node --> child node
data
means the value of this path.
tree:([]parent:`A`A`A`B`B`E`E;child:`B`C`D`E`F`G`H;data:(1;2;3;4;5;6;7));
My question is:
- For every non-leaf node (Red node in the chart), we can get a subtree based on this non-leaf node as root.
- Then we can get paths:
root -> every leaf node
- plus, we can get a value to every path,
value = multiply each data on this path
This chart shows what I want to say.
For myself, I can get every paths like this. But, I was stuck on how to calculate the data when walkthrough the tree.
map: exec child by parent from tree;
pl:exec distinct parent from tree; / parent list
(map\)pl / get all paths from every non-leaf node