See examples in Tree.mw
PrintTree(tree,/level,str,{filedesc,prefix},$)
print tree data structure tree::list (hierarchical list), where
level::nonegint:=0 is the root level;str::procedure:=(x->x) prints one node of the tree;filedesc::{string,integer}="" file name or descriptor if output is to the file, "" means terminal;prefix::string:="." for level alignment.Tree2Seq(tree,/prefix,str,{separator},$)::seq(string)
convert tree to decorated sequence of strings, where
prefix::string:="" is inserted before each entry;str::procedure:=(x->x) converts or prints one node of the tree;separator::string:="/" is between parent and child.Tree2Seq2( tree::list, index::list(posint):=[], size::posint:=1, body::procedure:=(x->x),$)::seq([body,index,numberofchilds::nonnegint])
linearize tree and generate tree indexes, where
index::list(posint):=[] is index of a node in the tree,
e.g. [2,5] means 5th child of 2nd child of the root, where [] denotes the root node;size::posint:=1 - the first size elements of a tree record are considered as the node information;body::procedure:=(x->x) - each node information is processed by body(`if`(size=1,tree[1],tree[..size])).Tree2List( tree::list, size::posint:=1, body::procedure:=(x->x),$)::list([body,parent::nonnegint,children::list(posint))
convert tree to list with parent and children indexes,
where 0 denotes the parent of the root node.