Basic Termonology of Tree
Basic Termonology of Tree
1. Tree
A tree is a non-linear data structure consisting of nodes connected by edges, arranged in a
hierarchical manner.
2. Node
A node is a fundamental unit of a tree that contains data and may have links to other nodes
(children).
3. Root
The root is the topmost node in a tree. It is the only node without a parent.
4. Edge
An edge is a connection between a parent and a child node in a tree.
5. Child
A child is a node that descends from another node (its parent) in the hierarchy.
6. Parent
A parent is a node that has one or more child nodes.
7. Leaf (or External Node)
A leaf is a node that does not have any children.
8. Internal Node
An internal node is any node in the tree that has at least one child.
9. Subtree
A subtree is a portion of a tree that includes a node and all its descendants.
10. Level
The level of a node represents its distance from the root, with the root being at level 0.
11. Depth
The depth of a node is the number of edges from the root node to that node.
12. Height
o Height of a node: The number of edges on the longest downward path from the node to a
leaf.
o Height of a tree: The height of the root node.
13. Degree
The degree of a node is the total number of children it has.
14. Sibling
Siblings are nodes that share the same parent.