
- Tree: A hierarchical structure used for organizing and searching data efficiently.
- Nodes: Fundamental units of the tree, connected by edges, forming a hierarchy.
- Root Node: The topmost node with no parent, starting point of the tree.
- Child Nodes: Nodes that descend from another node (parent).
- Leaf Nodes: Nodes with no children.
- Recursive Structure: Each node can have child nodes, and those child nodes can have their own children, forming a recursive hierarchy.
Key Terminologies:
- Parent Node: The predecessor of any given node. (Example:
{B} is the parent of {D, E})
- Child Node: The immediate successor of a parent node. (Example:
{D, E} are the children of {B})
- Root Node: The node at the top of the tree, without any parent. (Example:
{A})
- Leaf Node (External Node): Nodes without any children. (Example:
{I, J, K, F, G, H})
- Ancestor: Predecessor nodes along the path from the root to a given node. (Example:
{A, B} are ancestors of {E})
- Descendant: A node that is a child or below another node.
- Sibling: Nodes that share the same parent. (Example:
{D, E} are siblings)
- Level of a Node: Number of edges from the root to the node. (Root node level = 0)
- Internal Node: A node with at least one child.
- Neighbor: The parent or child of a node.