You are on page 1of 2

1

Name: ID:

Design and Analysis of Algorithms


Summer 2020, Faculty – ARa2
MS Qualifying Exam, Marks: 20, Time: 1 hour
Date: _____________
(You may use calculator. You may use pencil. Answer serially.)

Simulation (Answer any ONE question) [1*10 = 10 points]

1. You have two genes from two species: one is: X = "ATCGAGU" and the other is: Y = "ATCGTU". You
want to compute the similarity between these two genes to understand the evolutionary relationship
among them. Which quantity should you compute to do so? How can you compute this quantity using a
matrix/2D array? Show both the cost and the arrows for each cell in that matrix.

2. Use DFS to compute all the strongest connected components (SCCs) in the following graph. Show the
starting & finishing times of all the nodes after you apply DFS.

3. Apply Dijkstra’s algorithm on the following graph and compute the distance from node B (source node)
to all other nodes. Draw the graph that results after each iteration completes. In each of these graphs,
show the shortest path distance from the source node to each node, v (d[v]) as well as the predecessor of
each node v in the shortest path (π[v]).
2

Short Questions (Answer any TWO questions) [2*5 = 10 points]


4. Define any two of the following terms and give examples/explanations of each:
a. Class P problems
b. NP-Complete Problems
c. Travelling Salesman Problem (TSP)
d. Hamiltonian Cycle Problem
e. Approximation ratio

5. Define the properties of a (i) Greedy OR a (ii) DP problem. Explain these properties using a problem as
an example.

6. Explain the difference between decision problem and search problem with examples.

7. Explain amortized running time with an example.

You might also like