Professional Documents
Culture Documents
Midtermpapers2016
Midtermpapers2016
Q1) Write down the Brute Force Chain Matrix Multiplication Algorithm and its complexity (5
marks)
Q2) Prove that n^2 belongs to O(n^2) (5 marks)
Q3) Write a pseudo Code of algorithm of finding closest pair in 2-D using divide and conquer
approach. (10 marks)
Q4) Solve the recurrence using substitution method
T(n)=T(n-1)+c (10 marks)
Total 4 questions
1.pseudo code for n line assembly
2.devide and conquer
3.n(sqr)+n=O(n power 3)
4.f(n)=o(g(n)=g(n)=omega.f(n)
My paper of CS702
CS702
Qs2 write psuedo code using bruit force 3d closest node finding
Qs3 write pseudo code for assembly line using dynamic programming
Qs4 write pseudo code for 0/1 knapscak problem using dynamic programming
CS702
1. 1. Consider the problem of a chain < A1, A2, A3> of three matrices. Suppose the
dimensions of the matrices are 10×100, 100×5 and 5×50. For the sequence of matrices,
given above, compute the order of the product, A1.A2.A3, in such a way that minimizes
the total number of scalar multiplications.
1. Write the pseudo code of n-line assembly: dynamic programming algorithm for print
stations.
1. Show that the sum of cubes of any three consecutive positive integers is divisible by 9.
1. We have to compute the set of maximal points from following points, using Brute Force
Approach,
(2, 8), (6, 16), (8, 8), (10, 20), (12, 6), (16, 14), (18, 18), (20, 2), (24, 8)
1. Write the pseudo code of assembly line scheduling algorithm using dynamic
programming.
1. Write the pseudo code of complete knapsack dynamic programming algorithm for 0-1
knapsack problem.
2. Prove by mathematical induction that the sum of odd number is equal to the square of its
nth term.
1. Write down the Brute Force Chain Matrix Multiplication Algorithm and its complexity.
2. Write the pseudo code of n-line assembly: dynamic programming algorithm for print
stations.
3. 3. Prove the following by induction.
tn – 4tn-1 = (n + 3)5n
1. Show that
1. Write the pseudo code of assembly line scheduling algorithm using dynamic
programming.
2. Write the pseudo code of n-line assembly algorithm using dynamic programming.
(r V p)à(p V q) (r V (pàq))