Assignment Question
Assignment Question
UNIT1
1) For the given set of value 35, 36, 25, 47, 2501, 129, 65, 29, 16, 14, 99. Create a hash
table with size 15 and resolve collision using open addressing techniques.
2) Represent the following key in memory using Linear probing with and without
replacement. Use modulo 10 as your hashing function. 24, 13, 16, 15, 19, 20, 22, 14,
17, 26 11.
3) Insert the following data in the hash table of size 10 using linear probing with
chaining without replacement : 131, 3, 4, 21, 61, 6, 71, 8, 9
4) For the hash table size of 10 using hash function key F(key) = key % 10 insert the
following keys :
65, 75, 25, 29, 85, 39, 36. Use linear probing with chaining without replacement
25, 3, 21, 13, 1, 2, 7, 12, 4, 8 Use linear probing with replacement
5) Add following keys in hash table by applying extendible hashing mechanism. Assume
capacity of each directory to store buckets is 3. Keys are 10, 20, 15, 12, 25, 30, 7, 11,
08.
UNIT 2
1) Explain the Binary Search Tree in details with following example. Contruct Binary
Search Tree(BST) for the following :
a) J, R, D, G, T, E, M, H, P, A, F, Q
b) MAR, MAY, NOV. AUG, APR, JAN, DEC, JUL, FEB, JUN, OCT, SEPT
2) Let characters a, b, c, d, e, f has probabilities 0.07, 0.09, 0.12, 0.22, 0.23, 0.27
respectively. Find an optimal Huffman code and draw Huffman tree.
3) Generate binary tree for the following pre-order and in-order traversals :
Pre-order : E A C K F H D B G
In-order : F A E K C D H G B
4) Construct threaded binary tree step by step if the preorder traversal is G, B, D, C, A, K,
Q, P, R & in-order traversal is B, A, C, D, G, K, P, Q, R. Delete G and redraw a tree.
5)Perform inorder,preorder and postorder of following tree:
UNIT 3
1)
2)
3)
4)
5)
UNIT 4
1) Construct an AVL Tree for following data :
a. 50, 25, 10, 5, 7, 3, 30, 20, 8, 15
b. 1, 2, 3, 4, 8, 7, 6, 5, 11, 10
c. MAR, MAY, NOV, AUG, APR, JAN, DEC, JULY
2) What is OBST? List binary search tree with 3 words (w1, w2, w3) = (do, if, stop)
words occurs with probabilities (P1, P2, p3) = (0.4,0.5,0.1) find expected access
time in each case.
3) 3 Build AVL tree for given sequence of data. Show balance factor of all nodes
and name the rotation used for balancing the tree
40,60,80,50,45,47,44,42,75,46,41.
4) Construct the AVL tree for the following data by inserting each of the following
data item one at a time : Example-1 : 10, 20, 15, 12, 25, 30, 14, 22, 35, 40
Example-2 : 30, 50, 110, 80, 40, 10, 120, 60, 20, 70, 100, 90 14.
5) Find the Optimal Binary Search Tree for the : Identifier set {a1, a2, a3} = {do, if,
while} Where n = 3 and Probabilities of successful search as {p1, p2, p3} = {0.5,
0.1, 0.05} and Probability of unsuccessful search as {q0, q1, q2,q3} = {0.15, 0.1,
0.05, 0.05}
UNIT 5
1) Construct B-tree of order 4 by inserting the following data one at a time. 20, 10, 30,
15, 12, 40, 50 9.
2) Build B+ tree of order 3 for the following: 1, 42, 38, 21, 31, 10, 17, 7, 31, 25, 20, 18
10.
3) Construct B tree of order 5 for the following data: 78, 21, 14, 11, 97, 85, 74, 63, 45,
42, 57
4) Insert the following keys to a 5-way B tree A, G, F, B, K , D, H, M, J, E, S, I, R, X, C,
L, N, T, U, P
5) Construct B+ tree of order 4 for the following data : C, N, G, A, H, E, K, Q, M, F, W,
L, T, Z, D, P, R, X, Y
UNIT 6
1) Explain following operations carried out on sequential files. i) Add ii) Delete iii)
Search
2) Write short notes on: i) Factors affecting the file organization ii) Indexed sequential
files iii) Indexing techniques
3) A write a C++ program to create a file. Insert records into the file by opening file in
append mode. Search for a specific record into file.
4) Sort the following elements using two way merge sort with m = 3. 20, 47, 15, 8, 9, 4,
40, 30, 12, 17, 11, 56, 28, 35 15.
5) A file of employees records, has ‘employee no’ as primary key and the ‘department
code’ and the ‘designation code’ as the secondary keys. Write a procedure to answer
the following query – ‘Which employees from systems department are above
designation level 4?.