0% found this document useful (0 votes)
7 views2 pages

Dsad

The document outlines the details of an end-semester test for the M.Tech (DSE) program at Birla Institute of Technology & Science, Pilani, including course information, exam nature, and instructions for candidates. It consists of 10 questions covering various topics in data structures and algorithms, such as recurrence relations, matrix-chain products, Huffman coding, Kruskal's algorithm, and KD trees. The exam is open book and has a weightage of 40% with a minimum duration specified.

Uploaded by

Sam Praveen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Dsad

The document outlines the details of an end-semester test for the M.Tech (DSE) program at Birla Institute of Technology & Science, Pilani, including course information, exam nature, and instructions for candidates. It consists of 10 questions covering various topics in data structures and algorithms, such as recurrence relations, matrix-chain products, Huffman coding, Kruskal's algorithm, and KD trees. The exam is open book and has a weightage of 40% with a minimum duration specified.

Uploaded by

Sam Praveen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


Second Semester 2020-2019
M.Tech (DSE)
END -Semester Test (EC-3 Make-Up)

Course No. : DSECLZG519


Course Title : DATA STRUCTURE ALGORITHMS AND DESIGN
Nature of Exam : Open Book
No. of Pages = 2
Weightage : 40%
No. of Questions = 10
Duration : Min
Date of Exam :

Note:
1. Please follow all the Instructions to Candidates given on the cover page of the answer book.
2. All parts of a question should be answered consecutively. Each answer should start from a fresh page.
3. Assumptions made if any, should be stated clearly at the beginning of your answer.

1𝑛 =0
1. Find the recurrence relation of T(n) = ! [3M]
𝑇(𝑛 − 1) + log 𝑛 , 𝑛 > 0

2. Find an optimal parenthesization of a matrix-chain product whose sequency dimension


is (4,10,3,12,20,7) [6M]

3. Fill out the bottom-up dynamic programming table for the 0-1 knapsack program. given
a 10 kg sack and the following items [4M]
I 1 2 3 4
Vi 10 40 30 50
Wi 5 4 6 3

4. We want to encode a text which characters T,H,E,C,A,S,O,N,M using Huffman coding,


source text S = THE CAT SAT ON THE MAT. [hint: need to consider space]
a. Construct the Huffman tree based on the frequencies in the source S. [3M]
b. Create a variable length code table for encoding all the characters present in the
source text S using Huffman’s algorithm such that the most frequently used
character has a shorter code length. [2M]

5. Use Kruskal’s algorithm, to find a minimum spanning tree of the given graph below.
Draw the resulting spanning tree and list the edge in the order they are picked by the
Kruskal’s algorithm. [4M]

Fig-1

Page 1 of 2
6. Get the transitive closure of the relation represented by the digraph below. Use the
warshall’s algorithm. All steps needed, and draw the digraph of the transitive closure
[4M]

7. Finding the median of a sorted array is easy: return the middle element. But what if you
are given two sorted arrays A and B. of size m and n respectively, and you want to find
the median of all the numbers in A and B? you may assume that A and B are disjoint .
a. Give a naïve algorithm running is 𝜃(m+n) time. [2M]
b. If m =n, give an algorithm that runs in 𝜃(logn)time. [2M]

8. The input for this problem is a set of n-tasks a1…an the tasks are to be executed by a
single processor starting at time t=0.each task ai requires one unit of processing time
and has an integer deadline di. moreover, if the processor finishes executing ai at time
t, where di ≤ t, then a profit pi is earned. Apply a greedy algorithm for maximizing the
total profit. [hint: if two tasks have the same profit, then ties are broken by alphabetical
order] [4M]
Task A B C D E F G H I J K
Deadline 4 3 1 4 3 1 4 6 8 2 7
Profit 40 50 20 30 50 30 40 10 60 20 50

9. Construct a KD tree for the following data. (5,8,7,9),( 4,3,2,1), (6,8,3,4), (8,9,6,2),
(7,7,6,3), (8,7,8,4), (9,6,9,2), (10,5,7,1). [3M]

10. Suppose that we use a linked list to represent a queue and that in addition to the enqueue
and dequeue functions(i.e., functions to add and remove elements from the linked list),
you want to add a new operation to the queue that deletes the last element of the queue.
Which linked structure do we need to use to guarantee that this operation is also
executed in constant time? Justify your answer. [3M]

###All the Best ###

Page 2 of 2

You might also like