You are on page 1of 2

Seat Number

~-023

*4044*

C5-204
Design and Analysis of Algorithms (New)
(252604)
P. Pages: 2
Time: Three Hours Max. Marks: 60

Instructions to Candidates:
1. Do not write anything on question paper except Seat No .
.2. Graph or diagram should be drawn with the black ink pen being used for writing
paper or black HB pencil.
3. Students should note, no supplement will be provided.
4. All questions are compulsory.
5. Figures to right indicate full marks.
6. Draw suitable diagrams wherever necessary.

1. Attempt any two. 12

a) What is an algorithm? Write an algorithm that finds GCD


(Greatest Common Divisor) of two numbers using rules of removal of recursion.

b) How Quick sort method of sorting works? Consider following array of nine
elements: 65, 70, 75, 80, 85, 60, 55, 50, 45. Apply function Partition on above
data, show your steps of application.

c) Write control abstraction of Greedy method. Consider following di-graph : Use


shortest path Algorithm to obtain in non-decreasing order, the lengths of the
shortest paths from vertex 1 to all remaining vertices.
10 20

2. Attempt any two: 12

a) What do you mean by non-deterministic algorithm? Write non-deterministic


algorithm that sorts an unsorted array of n positive integers.

b) What is principle of optimality? Write an algorithm for all pairs shortest path
problem to determine matrix A such that A (i, j) is length of shortest path from
ito j.

c) Define the following terms:


i) Implicii constraints ii) Explicit constraints
iii) Solution state iv) Answer state

. CIffiJ. 023 1 P.T.O


CfffiJ - 023

v) Live node vi) Dead node

3. Attempt any two: 12

a) What is maxheap? Write an algorithm that inserts all element into maxheap?
What is time complexity of your algorithm?

b) Discuss in brief Strassen's matrix multiplication approach. What is time


complexity of it?

c) Write a note on Huffman codes.

4. Attempt any two: 12

a) "Algorithm BFS visits all vertices in graph reachable from a vertex V". Justify
your answer.

b) What is Graph coloring? Write an algorithm - Nextvalue (k) which produces the
possible colors for xk after x1 through xk-1 have been defined.

c) Describe the classes of problems: NP - hard and NP - complete in brief.

5. Attempt any two: 12

a) Define following Asymptotic notations and give one example of each:


i) 0 [Big "oh"] ii) Q (Omega) iii) e (Theta)

b) Write Prim's minimum - cost spanning tree algorithm? What is time complexity of
this algorithm?

c) Describe in detail 8 queens problem that uses backtracking.

***"'**",

CfffiJ - 023 2

You might also like