Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
2nd mid term daa paper
1. Name of the Student ………… University Roll No. ……….
Subject: Design and Analysis of Algorithm Subject Code: KAC010 Max Marks: 30
Semester: 3rd Branch/Section: MCA Time: 1Hour
INSTRUCTIONS :
1. Attempt all sections
2. No “B” Answer Sheet will be provided
3. Student will not be allowed to leave the examination Hall before one hour
Q. 1 Attempt all. (4 x 2.5 = 10)
(a) Write any two differences between greedy and dynamic programming approach.
(b) How Binary Search Tree is constructed using J, R, D, T, G, E, A, M, H, F, Q, U, B.
(c) Discuss Knapsack problem as Dynamic programming approach or greedy approach.
(d) Write a recursive function for activity selection problem.
Q.2 Attempt each part. (2 x 5 = 10)
(a) Given two sequences X = <x1, x2….xn> and Y = <y1,y2,…..yn>. Write the algorithm for
longest common Subsequence (LCS) of x and y using Dynamic Programming. Also write a
subroutine to print the longest common sub sequence (LCS).
(b) Let n =4 (P1,P2,P3,P4)= (100,10,15,27) and (d1,d2,d3,d4)=(2,1,2,1) where pi are profits
on processes or job and di are deadlines of completion . Find the Optimal schedule.
Q.3 Attempt the following. (2 x 5= 10)
a) Discuss matrix chain multiplication with reference to dynamic Programming technique
and also apply on the following array
b) Write an algorithm to insert an element in BST and also explain it with an example.
30 1 40 10 25
DIT UNIVERSITY, DEHRADUN
SECOND MID-TERM EXAMINATION (ODD SEMESTER - 2015)
(MCA 2nd Year Students only)