IT2 Answer Key
IT2 Answer Key
Part B (16*2=32)
1 What is collision? How is it overcome using separate chaining? Using hash function key
1) mod 7 hash the keys 50,700,76,85,92,73,101.Use separate chaining when collision occurs.
a) 16 marks
Collision - 2 mark
How is it overcome using separate chaining - 2 mark
Using hash function - 12 marks
OR
Write a program to perform searching operations using linear and binary search. Give
b example 16 marks
) Linear search program - 8 marks
Binary search program - 8 marks
1 What is heap?How to build a max heap and min heap? Give example 8 marks
2) Heap - 2 marks
a) Min-Heap with example - 3 marks
i) Max Heap with example – 3 marks
Construct an expression tree for the expression (a+b*c)+(d*e+1)*g).Give the outputs when
you apply Preorder,inorder and Postorder traversals. 8
i marks
i
) Constructing expression tree - 5 marks
Output for Preorder traversal - 1 mark
Output for Preorder traversal - 1 mark
Output for Preorder traversal - 1 mark
OR
Construct a binary search tree by inserting 3,1,4,9,6,5,2,8 and 7 into an initially empty
b tree.show the results of deleting the nodes 1,6,and 7 one after the other of the constructed
) tree 8
i marks
)
1. Constructing the Binary Search Tree (BST): 5 marks
2. Deleting Nodes: 3 marks