Question Paper Code:: (10×2 20 Marks)
Question Paper Code:: (10×2 20 Marks)
Reg. No. :
10. What is LC search and how it is efficient from other search methods in branch
and bound algorithms ?
X 10314 -2- *X10314*
11. a) i) Consider the problem of counting, in a given text the number of substrings
that start with an A and end with a B. For example, there are four such
substrings in CABAAXBYA. Design a brute-force algorithm for this
problem and determine its efficiency class. (8)
ii) “The best-case analysis is not as important as the worst-case analysis of an
algorithm”. Yes or No ? Justify your answer with the help of an example. (5)
(OR)
b) i) Solve : T(n) = 2T(n/2) + n3. (4)
ii) Explain the importance of asymptotic analysis for running time of an
algorithm with an example. (4)
iii) Write and explain recursive algorithm to find the factorial of any given number
n > = 0. Find the time complexity. (5)
12. a) i) Let x1 < x2 < ... < xn be real numbers representing coordinates of n villages
located along a straight road. A post office needs to be built in one of these
villages. Design an efficient algorithm to find the post-office location
minimizing the average distance between the villages and the post-office. (8)
ii) Explain how exhaustive search can be applied to the sorting problem and
determine the efficiency class of such an algorithm. (5)
(OR)
b) i) Write an algorithm using divide and conquer to search an element in a
list of numbers. If the number is not present, the algorithm returns the
closest number of the searches number. (8)
ii) What is Strassen’s matrix multiplication and explain how it is solves the
problem using divide and conquer technique. (5)
13. a) i) Compare and contrast dynamic programming and greedy method. (5)
ii) Write the algorithm for optimal binary search tree and solve the following
problem instance to construct the optimal binary search tree. Keys are
a, b, c, d and the probabilities are 0.1, 0.2, 0.4 and 0.3. (8)
(OR)
*X10314* -3- X 10314
b) i) Write the prim’s algorithm to find the minimum spanning tree and
illustrate the algorithm for the following graph. Where a, b, c, d and e are
nodes and each edges are weighted by numbers. (8)
ii) What is multistage graph ? List any three applications of multistage graph. (5)
14. a) i) Find a stable marriage matching for the instance defined by the following
ranking matrix : (8)
a B c D
α 1, 3 2, 3 3, 2 4, 3
β 1, 4 4, 1 3, 4 2, 2
γ 2, 2 1, 4 3, 3 4, 1
δ 4, 1 2, 2 3, 1 1, 4
ii) Determine the time efficiency of the above algorithm in the worst case. (5)
(OR)
b) Advertising alternatives for a company include television, radio and newspaper.
The table below shows the costs and estimates of audience coverage for each
types of media.
Cost per Audienceper
advertisement advertisement
Television $20000 100, 000
Newspaper $ 600 40, 000
Radio $ 300 18, 000
15. a) i) What are the general approaches exit for branch and bound algorithms ?
Also explain the data structure need for storing live nodes in each approach
with suitable example. (5)
ii) Write the algorithm for solving 0/1 knapsack problem using LC branch
and bound and solve the knapsack instance ; n = 4; (p1, p2, p3, p4) = (10,
10, 12, 18); (w1, w2, w3, w4) = (2, 4, 6, 9) and M = 15, using LCBB, Draw
the state space tree. (8)
(OR)
b) i) Write the algorithm for sum of subsets problem using backtracking technique. (8)
ii) Illustrate the algorithm for the instance n = 6, M = 30 and W = (5, 10, 12,
13, 15, 18). Draw possible state space tree. (5)
16. a) i) Assume {500, 100, 50, 20, 10, 5} currency of denominations is available
in a bank. Devise a greedy algorithm to obtain the minimum number of
denominations for any amount which is a multiple of 5. Find the time
complexity of your algorithm. (5)
ii) Explain the maximum-bipartite-matching problem with an illustration. (5)
iii) Prove that TSP problem is NP complete, assuming that Hamiltonian
problem is NP complete. (5)
(OR)
b) i) Solve the TSP using branch and bound technique. (10)
a B c D
a ∞ 12 5 7
B 11 ∞ 13 6
c 4 9 ∞ 18
D 10 3 2 ∞
ii) Explain the operations of approximate vertex cover and Give an example of
a graph for which APPROX-VERTEX-COVER always yields a suboptimal
solution. (5)
–––––––––––––