Tut 4 Dsa
Tut 4 Dsa
Tutorial Sheet 4
SECTION A (5*2=10)
1. Define a complete binary tree.
2. What is the difference among three types of traversals in a tree?
3. What is the key rule of BST?
4. Why do we call AVL tree a self-balancing tree?
5. How are binary trees represented in memory?
SECTION B (3*7=21)
1. Construct an AVL tree using following sequence: 21,26,9,4,14, 28, 18, 15, 10, 2, 3, 7.
2. Consider the following tree:
SECTION C (3*11=33)
1. Given a BST in pre-order as {13,5,3,2,11,7,19,23}{13,5,3,2,11,7,19,23}, draw this BST
and determine if this BST is the same as one described in post-order
as {2,3,5,7,11,23,19,13}{2,3,5,7,11,23,19,13}.
2. Draw a binary tree using following traversal sequence:
In-order: D, B, E, A, F, C, G
Post-order: D, E, B, F, G, C, A
Find its preorder traversal sequence.
3. The preorder traversal sequence of a binary search tree is-
30, 20, 10, 15, 25, 23, 39, 35, 42
Which one of the following is the post-order traversal sequence of the same tree?
1. 10 , 20 , 15 , 23 , 25 , 35 , 42 , 39 , 30
2. 15 , 10 , 25 , 23 , 20 , 42 , 35 , 39 , 30
3. 15 , 20 , 10 , 23 , 25 , 42 , 35 , 39 , 30
4. 15 , 10 , 23 , 25 , 20 , 35 , 42 , 39 , 30