Professional Documents
Culture Documents
~-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.
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.
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.
a) What is maxheap? Write an algorithm that inserts all element into maxheap?
What is time complexity of your algorithm?
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.
b) Write Prim's minimum - cost spanning tree algorithm? What is time complexity of
this algorithm?
***"'**",
CfffiJ - 023 2