Home > WaCoLab > package > @tree > linearizeTree2.m

linearizeTree2

PURPOSE ^

linearizeTree2 -- Another linearization of a tree

SYNOPSIS ^

function lintree = linearizeTree2(tree,parentLinLbl,nbChildrenPassed)

DESCRIPTION ^

linearizeTree2 -- Another linearization of a tree

 input:
   tree: the tree to linearize
   parentLinLbl: only for recursion purposes
   nbChildrenPassed: only for recursion purposes
 output:
   An array with the number of nodes as length. Each position in the array 
   represents a node and indicates the position of his parentnode.
   So 5 on position 6 in the array indicates that this node is a child of
   the node on position 5, in the following example this node has a number
   1 so it is a child of the node on position 1. This node on position 1
   allways has number 0 because it is the root node.
 example:
 For the tree
   o node1 1
   |-node2 2
   |   |-node2 3
   |   |-node1 4
   |-node3 5
   |   |-node2 6
   |   |-node1 7
 the result is as follows : [0     1     2     2     1     5     5]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 12-Oct-2007 20:23:47 by m2html © 2003