SAGE, UNIVERSITY INDORE
INSTITUTE OF ADVANCE COMPUTING
COMPUTER SCIENCE & ENGINEERING- DEPARTMENT
Program Name : B.Tech. CST (II Sem) Section - B
Course Name & Code : Data Structure and Algorithm - ACTDCDSA001T
Session : 2024-25 (Jan-Jun)
Assignment No :4
Note: Attempt all questions; submit in separate Copy (in your own handwriting)
1. Define the following terms with examples:
a) Root e) Height of a Tree
b) Leaf Node f) Degree of a Node
c) Parent and Child g) Binary Search Tree
d) Siblings h) AVL tree
2. Write a program/algorithm to create a general binary search tree.
3. Write a program to create a binary search tree from the following elements:
[40, 20, 60, 10, 30, 50, 70]
4. Print the final tree structure using in-order traversal.
5. Given the following BST:
50
/ \
30 70
/ \ / \
20 40 60 80
Write the output of:
a) In-order traversal
b) Pre-order traversal
c) Post-order traversal
6. Construct the binary tree and draw its structure.
a) Tree traversals:
1. In-order: D B E A F C
2. Post-order: D E B F C A
b) Tree traversals:
1. In-order: D B E A F C
2. Pre-order: A B D E C F
- - - - - Good Luck - - - - - -