- Root is at the top of the tree
- Each node except the root has exactly one node above it which is called its parent
- Nodes directly below a node are called its children
- Root does not have a parent; but each one of the other nodes has a parent node associated to it
- A node may or may not have children.
- A node that has no children is called a Leaf node
- A line from a parent to a child node is called a branch or an edge
- If the tree has n nodes, one of which is the root then there would be n-1 branches
It is a list of distinct vertices in which successive vertices are connected by edges in the tree
There is exactly one path between the root and some node
When there is no path between the root and some node, we get a GRAPH not a TREE.
Root does not have a parent; but each node associated with it has a parent node associated to it
A node may or may not have children
A node without children is called a leaf node
Nodes with at least one child is sometimes called non terminal nodes
Non terminal nodes – Internal nodes
Terminal nodes – External nodes
Ex. B,C,E,H,I,K,L,M are leaf nodes
Length of Path:
It is the number of branches on the path
If there is a path from node “n” to node “i”, then “n” is ancestor of “i”
There is a path of length zero from every node to itself
There is exactly one path from the root to each node
No comments:
Post a Comment