You are on page 1of 2

Mawlana Bhashani Science and Technology University

Department of Information and Communication Technology


1st Year 2nd Semester BSc. (Engg.) Final Examination 2020
Course Title: Data Structure Course Code: ICT 1205
Marks: 28 Time: 1.00 hours

Answer any two questions. Illustrate where necessary.

1 a Consider your mobile number as an array. Perform a Binary Search operation to find the number 8
5 in the array. Write the program and show the simulation steps.
[Hint: If your mobile number is 01723456789 then your array will be {0,1,7,2,3,4,5,6,7,8,9}]
b Consider the following stack, where STACK is allocated N=8 memory cells: 6
STACK: 1,5,3,8,9,0,11,--------
Describe the stack as the following operation take place:
i. PUSH ( STACK , 12)
ii. POP ( STACK , ITEM )
iii. PUSH ( STACK , 10 )
iv. PUSH ( STACK , 15 )
v. POP ( STACK , ITEM )
vi. PUSH ( STACK , 20)
vii. POP ( STACK , ITEM )
viii. POP ( STACK , ITEM )
ix. POP ( STACK , ITEM )
x. POP ( STACK , ITEM )
xi. POP ( STACK , ITEM )
xii. POP ( STACK , ITEM )
xiii. POP ( STACK , ITEM )
xiv. POP ( STACK , ITEM )
xv. POP ( STACK , ITEM )

2 a Write an algorithm for quick sort 12,45,56,78,90,32,66,55,11,44 elements of an array and show 5.5
what will happen in every pass.
b Compute the complexity of bubble sort algorithm for different scenario. 4
c Convert the following infix notation to respective prefix and post arithmetic notation 4.5
i. ((x*y)+z))
ii. ((x+y)*(z+t))
iii. ((x+y*z)-(u/v+w))

3 a How many techniques to traverse a tree? Classify it. 2


b Consider the following tree 6
Now apply the following traversal
i. In order
ii. Preorder
iii. Post order

c What is hashing? What are the types of hashing? What are the properties if hash function? 6

4 a A file contains the following message with the frequencies as shown below. If Huffman Coding is 6
used for data compression, determine-
Message: AABACDEFCCDDBCEEFF

i. Huffman Code for each character


ii. Length of Huffman encoded message (in bits)
b Write an algorithm to insert an item into the given position in linear array. 4
c Show the graph representation using the adjacency matrix and adjacency list. 4

You might also like