DMI COLLEGE OF ENGINEERING
(An Autonomous Institution)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CS1202- DATA STRUCTURES
UNIT III - TREES
PART A (2 Marks) (K1/K2 ONLY)
Q.NO Questions CO BT
1 Construct a binary tree for the expression (a+b) * ( c- d) CO3 K3
2 What is the difference between B tree and B+ tree? CO1 K2
3 What are the steps to convert a general tree into binary tree? CO1 K2
4 What are the applications of binary tree? CO1 K2
5 Distinguish between binary tree & binary Search tree. CO1 K2
6 The depth of the full binary tree is 8. Compute the number of leaf nodes in the tree CO3 K3
7 What are the two methods of binary tree implementation? CO2 K2
8 What are the properties of AVL trees? CO1 K2
9 Mention the types of rotations performed on AVL tree. CO1 K2
10 Define expression trees? CO1 K1
11 Perform Inorder, Preorder and Postorder Traversal in the following graph
CO3 K3
12 Compare full binary tree and skewed binary tree. CO1 K2
13 What are the different ways of representing a Binary Tree? CO1 K2
14 Distinguish binary search tree and AVL tree. CO1 K2
Give the prefix & postfix form of the following expression tree
CO3 K3
15
16 What is a heap? Outline the properties of a heap. CO1 K2
17 Why Binary Search tree is Binary tree but Binray Tree is not Binary Search Tree? CO1 K2
For the tree given below
(i)List the leaf nodes
(ii)List the Siblings of 6
18 (iii) Compute the height CO3 K3
19 What is complete binary tree? CO1 K1
20 What is Heap Tree? CO1 K2
21 Why AVL tree is binary Search tree but Binary Search Tree is not AVL tree? CO1 K2
22 Create an expression tree for the expression. ((a + ((b/c)*d))- e) CO3 K3
23 How do we calculate the balance factor for each node in an AVL tree? CO1 K2
A binary tree T has 9 nodes . The inorder and postorder traversals of T yield the
24 following: Inorder Traversal (I) : E A C K F H D B G, CO3 K3
Post Traversal (Po): E C K A H B G D F Draw the binary tree
25 Define a Binary heap. How can it be used to represent a priority queue? CO1 K2
PART B (13 Marks) (K2 AND ABOVE)
Q.NO Questions CO BT
Explain insertion and deletion operations in Min Heap and Max Heap with suitable
1 examples and diagrams CO2 K2
(i)State the binary Search tree property & outline the algorithm to search a binary search
2 tree with an example CO2 K2
(ii) Write the
(i) Show an insertion
result of Algorithm for binary Search
inserting 2,1,4,5,9,3,6,7 into tree andempty
intially Analyze
AVLits tree
complexity
(ii) Perform
3 deletion at 3 cases CO3 K3
(i) Explain how a postfix expression is converted into an expression tree using stack ii)
4 Construct expression tree for the expression ABC/-AK/L-* using stack & Justify your CO3 K4
Answer
(i)show the result on inserting 48,0,-1,82,108,72,54 in an empty Max heap (ii) deletion
5 CO3 K3
root node & heapify repeatedly
(i) Define Tree Traversal & Classify the three types of binary tree traversal (ii) Write the
6 CO2 K2
Pseudocode for Preorder, inorder & Post order traversal with an example.
(i) Write the insertion algorithm for binary search tree and analyze its complexity
7 (ii) List the principles of B-tree and explain how a node can be inserted into a B-tree CO2 K2
with an example
(i) Show the result of inserting 22,28,20,25,22,15,18,10,14 into an initially empty binary
8 search tree & (ii) Perform deletion at 3 cases & Justify your answer CO3 K3
(i) Explain AVL rotations with a suitable example
9 (ii) The height of the full binary Tree, Complete Tree,Perfect binary Tree & Skewed CO2 K2
binary Tree is 8 Compute number of leaf nodes for each
Write a C function for the following in the Binary Search tree
10 (i)To find the height of a tree (ii)To Find Minimum and Maximum (iii)Preorder CO2 K2
Traversal
PART C (15 Marks) (K2 AND ABOVE)
Q.NO Questions CO BT
Construct expression Tree from the following postfix expression using stack & Justify
1 your result i)AB+D*EFGD*+/+C+ ii)pq*rst/-+ CO3 K4
2 (i) Construct an expression tree for the expression (a + b * c) +((d * e + 1) * g). (ii) Give CO3 K3
the outputs when you apply preorder,inorder and postorder traversals
(i) Construct a B Tree with order m = 3 for the key values 2,3,7,9,5,6,4,8,1 and delete
3 the values 4 & 6 (ii) (i) Explain about B+ trees with algorithm to insert a node into a B+ CO3 K3
tree with example
(i)) Write Preorder,Inorder and Post order traversal ii)Write down the leaf nodes ,compute
siblings of leaf nodes & depth of the follwing trees
4 CO3 K3
(i)Distinguish between Binary tree, general tree and binary search tree and also give an
example. (ii) For the Given the AVL tree Draw the resulting balanced tree step by step
after 5 is removed .Label each node with balance factor
5 CO3 K3