1
Trees And Binary Trees
(Chapter 8)
,2
Outline
Trees: Definition and Basic Terminologies
Representation of Trees
Binary Trees: Basic Terminologies and Types
Representation of Binary Trees
Array representation of binary trees
Linked representation of binary trees
Binary Tree Traversals
Inorder traversal
Postorder traversal
Preorder traversal
Applications
ADT for binary trees
,3
• A tree is defined as a finite set of one or more nodes such
that
• There is a specially designated node called the root and
• The rest of the nodes could be partitioned into t disjoint sets
(t >0) each set representing a tree Ti, i=1,2, . . . t known as
subtree of the tree.
• A node in the definition of the tree represents an item of
information, and the links between the nodes termed as
branches, represent an association between the items of
information.
Trees And Binary Trees
(Chapter 8)
,2
Outline
Trees: Definition and Basic Terminologies
Representation of Trees
Binary Trees: Basic Terminologies and Types
Representation of Binary Trees
Array representation of binary trees
Linked representation of binary trees
Binary Tree Traversals
Inorder traversal
Postorder traversal
Preorder traversal
Applications
ADT for binary trees
,3
• A tree is defined as a finite set of one or more nodes such
that
• There is a specially designated node called the root and
• The rest of the nodes could be partitioned into t disjoint sets
(t >0) each set representing a tree Ti, i=1,2, . . . t known as
subtree of the tree.
• A node in the definition of the tree represents an item of
information, and the links between the nodes termed as
branches, represent an association between the items of
information.