CS702 Solved 15 Questions Most Important
CS702 Solved 15 Questions Most Important
Proof
• Since f(n) = Q(g(n)) i.e. f(n) Î Q(g(n)) Þ
$ constants c1, c2 > 0 and n0 Î N such that
0 £ c1g(n) £ f(n) £ c2g(n) " n ³ n0 (1)
Question NO. 4:
Question NO. 5:
Question NO. 6: Write psedocode of Assembly line scheduling dynamic programming
algorithm for print station.
Question NO. 7: Write pesedocode of plane sweep algorithm in n- dimension.
Optimal Weight Convex polygon problem cannot be solved using divide and conquer approach
because:
Its sub problems are not independent from each other.
We need an optimal solution of the problem, which may not be found using divide and
conquer approach.
Question NO. 12: Consider the problem of a chain of A1, A2 and A3 of three matrices, suppose
the dimensions of the matrices are 10x100, 100x5, and 5x50. For the sequence of matrices given
above compute the order of product A1, A2 and A3 is such a way that minimum total number of
scalar multiplications.
SOLUTION:
Main Diagonal
, ,
Computing m[1,3]
0 5000 7500 1 4 6
0 25,000 2 5
0 3
0 1 2
0 2
0
Order of Computation will be
1 A3
A1 A2
Question NO. 13: Given a comparison of divide and conquer approach and dynamic
programming. Give the reasoning that why the optimal weight convex polygon problem cannot
be solved using divide and conquer approach.
SOLUTION:
Reasoning:
A simple polygon is convex if given any two points on its boundary or in its interior all points on
the line segment drawn between them are contained in the polygon’s boundary or interior.
Optimal Weight Convex polygon problem cannot be solved using divide and conquer approach
because:
Its sub problems are not independent from each other.
We need an optimal solution of the problem, which may not be found using divide and
conquer approach.
Question NO. 14: Construct the fastest way using optimal solution. (5 marks)
Question NO. 15: Algorithm to Closest Pair in 2-D using Divide and Conquer approach. (10
marks)