# cs502 final Term paper 2011 by nouman100

VIEWS: 221 PAGES: 2

cs502 final Term paper current 2011

• pg 1
```									CS502 FUNDAMENTALS OF ALGORITHM
FALL 2011 FINAL
Note: All MCQ’s were from previous papers but some new and mostly was
related to ASCII caracter.
MCQ’s       40x1=40
SQ’s        4x2=8
4x3=12
4x5=20
Total Time 120 minute

SUBJECTIVE
1. Suppose we are able to prove that an NP-complete problem cannot be
solved in less than exponential number of steps, what would be
consequence? (2)
2. What is the total running time for edit distance algorithm? (2)
3. i) How Dijkstra’s algorithm operates?           (2)
ii) What is the running time for Dijkstra’s algorithm?
4. The following adjacent matrix represents graph for vertices         0 1 2 3
labeled 0,1,2,3. Suppose we encounter an algorithm that         0 0 1 0 3
work on weighted graph but we want to run it on an un-          1 2 0 4 0
weighted graph. How do we do so. (2)                            2 0 1 0 1
3 2 0 0 0
5. What is the application of edit distance technique? (3)
6. What is all pairs shortest path problem also describe Floyd Warshall’s
algorithm. (3)
7. Answer the following question according to Floyd Warshall’s algorithm. (3)
i) Running time.
ii) Space used.
8. Let the adjacency list representation of an undirected graph is given below.
Explain what general property of the list indicates that the graph has a loop.
(3)
abce
bad
cadef
dbcf
eacf
fcde
g
9. Suppose you could reduce NP-complete problem to a polynomial time
problem in polynomial time problem, what would be the consequence? (5)
10.Prove that a directed graph G is acyclic if and only if a depth-first-search of
graph G yields no back edge? (5)
11.Draw a Binary tree for this order of matrix multiplication (5)
((A1(A2A3))(A4,A5))
12.What is the cost of the following graph. (5)

```
To top