Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CS204 No.

of Printed Pages – 4 CS204


6. Attempt any One of the following questions: 4x1= Roll No.
4
(a) Define collision in hashing technique. The following keys 10, B.TECH. / B.TECH. - M.TECH. (DUAL DEGREE)
16, 11, 1, 3, 4,23 and 15are inserted into an initially empty THIRD SEMESTER EXAMINATION, 2021-22
hash table of length 10 using open addressing with hash DATA STRUCTURE USING C
function h(k) = k mod 10 and linear probing. What is the
Time: 3.00 Hours Max. Marks: 40
resultant hash table? [BT-5, CO-4, PO-3]
Note : (i) The question paper contains Three Sections.
(b) Write an algorithm for selection sort and discuss its (ii) Section-A is compulsory, Section-B and C contains internal
complexity. Illustrate the working of selection sort on the choice.
SECTION-A
following array with 7 elements : 30,45,25,32,55,60,49
1. Attempt ALL parts of the following questions: 1 x 10 =
[BT-6,CO-4,PO-5]
10

7. Attempt any One of the following questions: 4x1= (a) What is the advantage of linked list over arrays? [BT-1, CO-1, PO-2]

4 (b) What is the size of array A (3:10, -4:5). [BT-2, CO-1, PO-4]

(a) Describe Minimum Cost Spanning Trees. Using Kruskal’s (c) What is the postfix forms of the expression: [BT-2,

CO-2, PO-3]
algorithm finds the Minimum Cost Spanning Tree of the
A+B*(C-D)/(E-F)
following graph: [BT-5,
(d) In an empty stack of size 5 following operations are
CO-5, PO-2]
performed: Push(3); Push(5); Pop(); Push(2);
Push(3); Pop(); Push(4); Pop(); Pop(); What will be
the top element after the completion of all operation?
[BT-2, CO-2, PO-4]

(e) What is the pre-order traversal of the following binary tree:


[BT-2, CO-3, PO-2]

(b) What do you mean by file organization? Discuss various


primary file organization techniques.
[BT-4, CO-5, PO-6]
(f) Which element will become root of AVL tree, if elements are
inserted in an empty tree in the order 1, 2, 3, 4, 5? [BT-2,

CO-3, PO-4]

(g) What is the output of selection sort after the 2nd iteration for
the following sequence? 16 3 46 9 28 14.
[BT-2, CO-4, PO-3]

4 1 P.T.O.

CS204 CS204
(h) What are the average and worst case complexities of quick SECTION-C
sort algorithm? [BT-1, 3. Attempt any One of the following questions: 4x1=
CO-4, PO-4]
4
(i) What is the DFS traversal of the following graph?
(a) Write a program in C to capitalize first letter of each word in a
(Considering A as source node).
string. [BT-6,
[BT-2, CO-5, PO-5]
CO-1, PO-3]

(b) What is Linked list? Write an algorithm to delete a node of


given value from linked list.
[BT-5, CO-1, PO-4]

4. Attempt any One of the following questions: 4x1=


4
(a) Write an algorithm to convert an infix expression into
equivalent postfix. Trace the steps involved in converting the
infix expression A *(B-C)+D^E/(F+G) to postfix expression.
[BT-6, CO-2, PO-1]

(b) What is priority queue? Discuss different method to


implement a priority queue.
(j) What is primary index? [BT-1, CO-5, PO-3]
[BT-5, CO-2, PO-3]

SECTION-B 5. Attempt any One of the following questions: 4x1=


2. Attempt any TWO of the following questions: 5 x 2 = 4
10 (a) The preorder traversal sequence of a binary search tree is
(a) Consider an array A[8, 15]. If elements are stored in row 35, 24, 12, 16, 30, 28, 42, 40, 45. What is the post order
major order what will be the address of A[5,10] ? (assuming traversal of the tree?
base address is 600 and word size is 4 byte). [BT-6,CO-3 ,PO-5]

[BT-4, CO-1, PO-2] (b) A file contains the following characters with the frequencies
(b) What is the value of postfix expression as shown. [BT-5, CO-3, PO-6]

5 4 6 + * 4 9 3 / + *? [BT-3, CO-2, PO-4] Characters a b c d e F G


Frequencies 13 10 4 12 15 1 3
(c) A hash function h defined h(key)=key mod 7, with linear
If Huffman Coding is used for data compression, determine:
probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 (i) Huffman Code for each character
into a table indexed from 0 to 6. What will be the location of (ii) Average code length
key 63? [BT-4, CO-4, PO-2]
(iii) Length of Huffman encoded message (in bits).
(d) Construct an expression tree for the expression. [BT-4, CO-3, PO-2]

A+(B-C)*D+(E*F).

2 3 P.T.O.

You might also like