Page 220 - DCAP407_DATA_STRUCTURE
P. 220
Balraj Kumar, Lovely Professional University Unit 12: Binary Tree Traversals and Operations
Unit 12: Binary Tree Traversals and Operations
CONTENTS
Objectives
Introduction
12.1 Binary Tree Traversals
12.2 Preorder Traversal
12.3 Inorder Traversal
12.4 Postorder Traversal
12.5 Binary Tree Operations
12.5.1 Insertion
12.5.2 Deletion
12.5.3 Searching
12.6 Summary
12.7 Keywords
12.8 Self Assessment
12.9 Review Questions
12.10 Further Readings
Objectives
After studying this unit, you will be able to:
• Discuss the different kinds of binary tree traversals
• Explain in detail the preorder traversal
• Describe in detail inorder traversal
• Analyze and implement postorder traversal
• Explain binary tree operations
Introduction
In the previous chapter, we discussed the fundamentals of binary tree. In this chapter, we will discuss
the traversal and other operations of a binary tree.
Traversals are the most basic operations performed on binary trees. In traversal technique, each node of
a tree is systematically visited exactly once. The different traversal techniques are preorder, inorder, and
post order traversal.
The binary tree operations help in the logical implementation of the structure of a binary tree. The basic
operations such as insertion of a node, deletion and searching of node are performed on the binary tree
structure.
12.1 Binary Tree Traversals
Binary tree traversals refer to the commonly used traversing operations on a binary tree. Traversing
refers to the order in which traversing is performed on a node of the tree, its right and left sub-trees. It
deals with visiting each node in a tree exactly once. A complete traversal of binary tree provides the
sequential ordering of information in a tree.
LOVELY PROFESSIONAL UNIVERSITY 213