Unit 4 Previous Year Question
DATA STRUCTURE
Faculty
Name: Mrs. Rita Nagar
Prepared
By: Nitin Kumar(A2)
Short Answer Type Question:
1. Define extended binary tree, full binary tree, strictly binary tree and complete
binary tree.
2. Explain threaded binary tree.
3. What is the importance of threaded binary tree?
4. Draw the binary search tree that results from inserting the following numbers in
sequence starting with 11: 11, 47, 81, 9, 61, 10, 12,
5. Write advantages of AVL tree over Binary Search Tree (BST)
6. In a complete binary tree if the number of nodes is 1000000. What will be the
height
of complete binary tree.
7. What is the significance of binary tree in Huffman algorithm?
Long Answer Type Question:
1. What is the difference between a binary search tree (BST) and heap? For a given
sequence of numbers, construct a heap and a BST.
34,23,67,45,12,54,12,54,87,43,98,75,84,93,31.
2. Can you find a unique tree when any two traversals are given? Using the following
traversal construct the corresponding binary tree:
INORDER: H K D B I L E A F C M J G
PREORDER: A B D H K E I L C F G J M
3. What is B-Tree? Generate a B-Tree of order 4 with the alphabets(letters) arrive in
the sequence as follows:
agfbkdhmjesIrxclntup
4. If the in order of a binary tree is B, I, D, A, C, G, E, H, F and its post order is
I, D, B, G, C H, F, E, A then draw a corresponding binary tree with neat and
clear steps from above assumption
5. Write Short notes of following
(a) Extended Binary Trees (b) Complete Binary Tree
(c) Threaded Binary Tree.
6. Insert the following sequence of elements into an AVL tree, starting
with empty tree 71,41,91,56,60,30,40,80,50,55 also find the minimum
array size to represent this tree.
7. What is the significance of maintaining threads in Binary Search Tree? Write an
algorithm to insert a node in thread binary tree.
8. (i) Why does time complexity of search operation in B-Tree is better than Binary
Search Tree (BST)?
(ii) Insert the following keys into an initially empty B-tree of order 5
a, g, f, b, k, d, h, m, j, e, s, i, r, x, c, l, n, t, u, p
(iii) What will be the resultant B-Tree after deleting keys j, t and d in sequence?
9. The order of nodes of a binary tree in INORDER and POSTORDER traversal are as
follows:
In order: B, I, D, A, C, G, E, H, F.
Post order: I, D, B, G, C, H, F, E, A.
(i) Draw the corresponding binary tree.
(ii) Write the pre order traversal of the same tree.
10 What is spanning tree? Write down the Prim’s algorithm to obtain minimum cost
. spanning tree.
11 Discuss left skewed and right skewed binary tree. Construct an AVL tree by
. inserting the following elements in the order of their occurrence:
60, 2, 14, 22, 13, 111, 92, 86.
12 What is B-Tree? Write the various properties of B- Tree. Show the results of
. inserting the keys F, S, Q, K, C, L, H, T, V, W, M, R, N, P, A, B in order into a
empty B-Tree of order 5.
13 Write C function for non-recursive post order traversal.
.
14 If E and I denotes the external and internal path depth of a binary tree having n
. internal nodes then show that E=I+2n.
15 Suppose character a, b, c, d, e, f has probabilities 0.07, 0.09, 0.12, 0.22, 0.23,
. 0.27 respectively. Find an optional Huffman code and draw the Huffman Tree.
What is the average code length?
16 Construct a binary tree with the following traversals:
. INORDER: B C A E G D H F I J
PREORDER: A B C D E G F H I J
17 Construct an AVL Tree by inserting following sequence of elements, starting
. with an empty tree: 71,41,91,56,60,30,40,80,50,55
18 Construct a Binary Search Tree (BST) using the following sequence of
. numbers: 50, 30, 70, 20, 40, 60, 80, 35, 45. Perform INORDER traversal of Tree