Ms Qualifying Exam Algo
Ms Qualifying Exam Algo
Name: ID:
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
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.