Implementation--
Trees
Tree Nodes
Trees represent information in a hierarchical type of structure. Tree Nodes hold references to the actual data item represented by the node as well as child nodes, the current child node being worked on and the parent node. The leaf nodes have no child nodes and the root node has no parent. In SimPlan, we use a tree for
searching.
Functionality for trees includes setting and retrieving the references for the root and current nodes in the tree, retrieving the data held at the root, current, current node's parent and current node's child nodes, adding a root node to an empty tree, adding child nodes to the current node, adding entire trees with the root as a child or sibling of the current node, changing node data in the current node, removing leaf node children of the current node, removing entire subtrees and performing prefix and postfix traversals of the tree.
Functionality for tree nodes includes setting and retrieving the depth of the node in the tree, retrieving references for the parent and child nodes, retrieving the number of child nodes, adding and removing parent and child node references and finding child nodes containing given data.
Related include files:
Return ...
Andrew Tompkins
Beaverton, OR 97006
Last rev: 17 JUL 03
URL:
http://home.comcast.net/~andytom/simplan.docs/control/tree.html