Automatically extracted historical question data. Academic accuracy and examination rules require verification.
Part A — 1
Calculate the time complexity for the following algorithm. Specify-its upper and lower bounds.
Algorithm add{a,b,c,n)
‘\nput : a,b,c —matrices of size nxn (n-positive integer)
for i=1 ton do
for j=1 ton do.
efi, jJ=afi,j]+bf i,j)
NumericalSource quality review required
Part A — 2
List out the difference between Dynamic Programming and greedy approach.
Short DescriptionPart A — 3
Define optimal substructure.
DefinitionPart A — 4
Find the longest common subsequence for the following sequence W (a,a,c,b,d,a,c ) and
X( d,a,b,d,c).
NumericalPart A — 5
Mention the characteristics of Deterministic and Randomized Algorithm.
Short DescriptionPart A — 6
_ Find the optimal Huffman code for the following :
(Character, frequency) (a, 5) ; (6,2) :(d,4) ; 63); (f,3):( 9,1)
Other Or UnclassifiedSource quality review required
Part A — 7
What is basic solution? When can you say that a basic solution is an optimal solution?
DefinitionPart A — 8
Formulate a-dual Linear program for the following Linear Program
Maximize 2X+Y+Z
Subject to
X+V¥+2Z<=30
2127144224
32436
X,Y ,Z >=0
Other Or UnclassifiedSource quality review required
Part A — 9
Define P and NP problem.
DefinitionPart A — 10
List out the properties of NP-Complete (NPC) problem.
Short DescriptionPart B — 11
௨1) Write a randomized algorithm for hiring problem and perform an analysis of hiring (12)
problem using indicator random variable to compute the expected number of times
we hire a new office assistant. .
(ii) Solve the following recursive equation using recursive tree method and verify itby (4)
using Masters method.
T(n)= < b if n<3
A 31(n/3)tbn if n>=3
Other Or UnclassifiedSource quality review required
Part B — 12
a{i) Write the randomized Quicksort Algorithm and analyse its expected running time. (8)
(ii) Demonstrate the operation of counting sort on the array A= (2,0,0,5,4,2) (4)
(4) Give a brief justification for the lower bounds for comparison sort in worst case. (4)
Other Or UnclassifiedSource quality review required
Part B — 12OR
b.(i) Find an optimal parenthesization of a matrix- chain product for the following (8)
matrices of given order
At (10x3), B (3 x 5), C (5 x 2), D (2 x4)
(ii) Write an algorithm that computes an optimal order for multiplying the chain of (8)
matrix using Dynamic Programming strategy. Specify its time complexity.
Other Or UnclassifiedSource quality review required
Part B — 13
a. Write an iterative algorithm to solve the Activity selection problem using Greedy (16)
approach. Apply the algorithm to the following table and compute the result.
Activity() 1 {2 |3 {4 15 6 7
Start time (sj) 11 2 14 3 3 5 18
இணி பி 3 17 (6 5 8 (இர!
Other Or UnclassifiedSource quality review required
Part B — 13OR
b.(i) Solve the following Linear Equations using LUP decomposition - (10)
X+5Y+4Z=12
2X+3Z=9
5X+8Y+2Z=5
(ii) How many Scalar multiplications are required to multiply two 2 x 2 matrices using (6)
Strassen’s algorithm? Explain the steps included in Strassen’s approach to perform
Scalar multiplications.
Other Or UnclassifiedSource quality review required
Part B — 14
a.(i) Solve the following linear program using SIMPLEX algorithm: {8)
Maximize 10X+12Y
Subject to
X+Y¥<=40
X+2Y<=75
X, Y>=0 .
(ii) Explain the steps involved in SIMPLEX algorithm. (8)
.(OR)
Other Or UnclassifiedSource quality review required
Part B — 14
6.(i)
(4)
Other Or UnclassifiedSource quality review required
Part B — 15
௨.
45.b.(i)
(ii)
Write the KMP string matching algorithm and compare the running time efficiency
of KMP with Naive string matching algorithm in worst case.
Perform the String Matching process for the following Text and Pattern using KMP
algorithm.
. Text (T) => AABAABDABAABD
Pattern(P)=> AABD
Prove that Vertex Cover Problem is NP-Complete and explain the three key
concepts involved in showing a problem to be NP-Complete.
| (OR)
Write an approximation algorithm for any one NP-Complete problem and calculate
its approximation ratio.
Discuss on how to use a polynomial -time reduction algorithm to solve a decision
problem “X" in polynomial time given a polynomial time decision algorithm for
another problem “Y”.
(8)
(6)
(16)
(8)
(8)
Other Or UnclassifiedSource quality review required