Tree Traversal
Tree Traversal
Data Structures
Lecture: Tree Traversal
Contents
• Introduction
• Representing Binary Tree in Memory
• Linked Representation
• Sequential Representation
• Traversing Binary Tree
• Preorder
• Inorder
• Postorder
• Traversal algorithms using Stacks
• Review Questions
Introduction
• Trees are non-linear data structures.
INFO LEFT
RIGHT 2 ROOT0
A 6 4
E 0 0
10 C 0 9
AVAIL 8
B 7 3
D 0 0
1
F 0 0
5
Sequential Representation of Binary Tree