QN 3
QN 3
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) How can you say that performance analysis of an algorithm is the vital 8
part of an algorithm development stage? Justify, your answer in the
Light of time complexity and Space complexity.
b) What do you mean by randomized algorithms? Explain different types 7
of randomized algorithm with suitable examples.
2. a) Briefly explain a Queue data structure. Write algorithm to add and 8
remove an element from the circular queue and compute the
complexity of your algorithm.
b) Explain the basic principle of Divide and Conquer strategy for 7
algorithm design. Give an example of Divide and Conquer Algorithm,
and compute its complexity.
3. a) Explain Greedy approach of problem solving with reference to 7
Knapsack problem.
b) Consider a string editing problem where string X = a a b a b and Y = 8
b a b b. Each insertion and deletion has a unit cost and a change cost 2
units. Find a minimum cost edit sequence that transforms X in Y.
4. a) Explain complete binary tree with examples. Prove that the height of 8
the Binary tree with n number of nodes is log2 (n+1).
b) Explain optimal merge pattern problem. Formulate it to solve using 7
Greedy method. Does it use ordering paradigm? Explain.
5. a) Briefly explain the Dynamic Programming method for problem 7
solving. What is the basic difference between Dynamic Programming
and Greedy method?
b) Explain the Single Source Shortest Path problem having negative 8
weight graph. Write the algorithm to compute shortest path with
1
negative edge cost. Compute its complexity.
6. a) Design an algorithm implementing the concept of Depth First Search 8
to find the shortest (Directed) cycle. Containing a given vertex V.
b) Determine minimum cost and minimum cost path from vertex 1 to 7
vertex 11 of the following 5 stage graph problem using backward
approach of dynamic programming.
5 stage graph
7. Write short notes on: (Any two) 2×5
a) Graph coloring problem
b) Spanning Trees
c) Dictionaries.