Professional Documents
Culture Documents
Trees 1
Trees 1
ITS
PROPERTIES
GROUP 12
INTRODUCTION
DEFINATION: A tree is a simple ,
connected , undirected graph with no
simple circuits. This means there is a
unique simple path any two of its
vertices.
Basic Terminology:
Root: A binary tree has a unique node called the root of the tree.
Left Child: The node to the left of the root is called its left child.
Right Child: The node to the right of the root is called its right child.
Parent: A node having a left child or right child or both are called the parent of the nodes.
Siblings: Two nodes having the same parent are called siblings.
Leaf: A node with no children is called a leaf. The number of leaves in a binary tree can vary
from one (minimum) to half the number of vertices (maximum) in a tree.
Descendant: A node is called descendant of another node if it is the child of the node or child
of some other descendant of that node. All the nodes in the tree are
descendants of the root. 3
For the tree as shown in fig:
•Which node is the root?
•Which nodes are leaves?
•Name the parent node of each node
4
PROPERTIES OF TREES
5
ROOTED TREE
7
Theorem
In an m-ary tree:
• number of nodes n
• number of leaves l
• number of internal nodes i
• n=m·i+1
• l = n − i = m · i + 1 − i = (m − 1) · i + 1
• i = l−1 m−1
8
EXAMPLE
Q}How many matches are played in a tennis tournament of 27
players?
SOLUTION
9
BINARY TREES:
11
PATH LENGTH OF A
VERTEX:
• The path length of a vertex in a rooted tree
is defined to be the number of edges in the
path from the root to the vertex.
12
team
13
14