Tree Generation Algorithm Based on Prefix Code
In order to make the tree generation algorithm more general and to improve its operating efficiency,a tree generation algorithm based on the prefix code (TGABPC) is proposed. The nodes use prefix encoded data structure,which enables to facilitate fast queries and statistics on the data associated with the tree nodes and their lower sub-nodes. Because the nodes are sorted by preorder traversal before constructing a tree,and the recent nodes information on each layer are being recorded during building the tree,so the tree can be established directly without searching upper and lower nodes. As a result,a substantial increase in the efficiency of building a tree is achieved-the algorithm time complexity is O (n).The TGABPC can also construct an arbitrary sub-tree without any additional data pre-processing,and does not increase the algorithm complexity.