0% found this document useful (0 votes)
132 views

Dsa 1

The document contains the questions from a data structures and algorithms exam given on April 4, 2010. It includes 6 questions testing concepts like binary search trees, merge sort, longest common subsequence, inversions in arrays, task scheduling, and Kruskal's algorithm for minimum spanning trees. Students were given 3 hours to complete the open book exam worth 60% of their course grade.

Uploaded by

Ravi Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

Dsa 1

The document contains the questions from a data structures and algorithms exam given on April 4, 2010. It includes 6 questions testing concepts like binary search trees, merge sort, longest common subsequence, inversions in arrays, task scheduling, and Kruskal's algorithm for minimum spanning trees. Students were given 3 hours to complete the open book exam worth 60% of their course grade.

Uploaded by

Ravi Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


Second Semester 2009-2010
Comprehensive Examination (EC-2 Regular)

Course No. : IS ZC361


Course Title : DATA STRUCTURES AND ALGORITHMS
Nature of Exam : Open Book
Weightage : 60% No. of Pages =1
Duration : 3 Hours No. of Questions = 6
Date of Exam : 04/04/2010 (AN)
Q.1. Professor Amongus claims that the order in which a fixed set of elements is
inserted into a binary search tree does not matter - the same tree results every time.
Give a example that proves Professor Amongus is wrong. [10]

Q.2. Illustrate the performance of the merge sort algorithm on the input sequence:
2,5,16,4,10,23,39,18. [10]

Q.3. Illustrate the operation of the dynamic programming algorithm to solve the longest
common subsequence problem on the sequences 1, 0, 0, 1, 0, 1, 0, 1 and 0, 1, 0, 1,
1, 0, 1, 1, 0. [10]

Q.4. Let A[1…n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the
pair (i, j) is called an inversion of A.
(a). Which array with elements from the set {1,2,…n} has the most inversions?
How many does it have?
(b). Describe an algorithm that determines the number of inversions in any
permutation on n elements in Θ(n logn) worst case time. [4 + 6 = 10]

Q.5. Suppose we are given a set of tasks specified by pairs of the start times and finish
times as T = {(1,2), (1,3), (1,4), (2,5), (3,7), (4,9), (5,6), (6,8), (7,9)}. Solve the
task scheduling (activity selection) problem for this set of tasks. [10]

Q.6. Find the minimum cost spanning tree for the following graph using Kruskal’s
algorithm? [10]

B
10 28

A E
14 8
25 D
24
G
C 11
22
15
F

You might also like