Tree terminology includes common words associated with a tree and operations on it. The following are some of the words that are part of tree terminology.
Path: The sequence of lines which connect node to node of tree is called path
Root: The node at the top of a tree is called the root. There is only one root in a tree.
Parent: Any node (except root) that has at least one node as a child node, is called parent.
Child: All the nodes except root are child nodes.
Leaf: A node that has no child node can be called leaf-node.
Subtree: A sub-tree constitutes of a node and all its descendants
Visiting: Visting means reaching a particular node to either print it or perform some operation on it.
Traversing: Traversing means to visit all the nodes in some specified order.
Level: the level refers to number generations from the root of a tree (it is also called depth).
Keys: Key refers to a value (data-field) of a node.
0 comments:
Post a Comment