You are on page 1of 7

TREE

 A Tree is a
hierarchical
representation of a
finite set of one or
more data items such
that:
1)There is a special
node called the root of
the tree.
2)The node other than
the root node form an
ordered pair of disjoint
BINARY TREE
Binary Tree Definition:
Definition: A binary tree is either empty or consists
of a node called the root together with two binary
trees called the left subtree and the right subtree.

1.A Tree in which every node can have maximum


of two childern is called binary tree.

2.In a binary tree,every node can have either 0


childeren 1 child or 2 children but not more than 2
children.
Characteristics

Characteristics of Binary Tree:


 Every binary tree has a root pointer which points

to the start of the tree.


 A binary tree can be empty.

 It consists of a node called root,a left subtree and

tright subtree both of which are binary trees


themselves.
Binary Tree
Parts of a binary tree
 A binary tree is composed of zero or more nodes
 Each node contains:

1.A value (some sort of data item).


2. A reference or a pointer to a left child(may be
null),and
3.A reference or a pointer to a right child(may be
null).
 A binary tree may be empty(contains no nodes).
Parts of a binary tree continued

 If binary tree is not empty,a binary tree has a root


node.
Every node in the binary tree is reachable from the root node by
a unique path.
 A node with neither a left child nor a right child is
called a leaf.
In some binary trees,only the leaves contain a value.
Properties of a binary tree
A tree with n nodes has exactly(n-1) edges or
branches.
In a tree every node except the root has exactly
one parent(and the root node does not have a
parent).
There is exactly one path connecting any two
nodes in a tree.
The maximum number of nodes in a binary tree of
height K is 2^K+1-1 where k>=0.

You might also like