BHARAT INSTITUTE OF ENGINEERING & TECHNOLOGY

B.Tech II year II SEM – MID-II EXAMINATION
BRANCH: II CSE A
SUBJECT: Design and analysis of Algorithms
Date: .4.2015 FN
Answer any two
Max. Marks: 10 Set-1
(a)Explain the P, NP, NP-Hard and NP- complete classes with suitable examples.
(b)Draw the portion of state space tree generated by LCBB for the knapsack
instances: n = 4; (P1; P2;P3 ; P4) = (10; 10; 12; 18); (w1w2;w3;w4) = (2;4; 6; 9 )
and M = 15
(c)I) Let w = {6; 15; 20; 10; 11; 18; 29} and m=35. Find all possible subsets of w
that sum to m. Draw the portion of the state space tree that is generated. (II)
Differentiate between Live node and E-node.
(d)Construct an optimal binary search tree for the following data: n=4,
(a1,a2,a3,a4)= ( do, if, int, while), p(1:4)= ( 3,3,1,1) and q(0:4)= ( 2,3,1,1,1).
(e)Find an optimal solution to the 0/1 knapsack instance, given n=3, weights and
profits as (w1,w2,w3)=(2,3,4) , p1,p2,p3)= (1,2,5) and knapsack capacity =6
generate the sets Si using dynamic programming.

BHARAT INSTITUTE OF ENGINEERING & TECHNOLOGY
B.Tech II year II SEM – MID-II EXAMINATION
BRANCH: II CSE A
SUBJECT: Design and analysis of Algorithms
Date: .4.2015 FN
Answer any two
Max. Marks: 10
Set-2
(a)Explain Branch and bound.
(b)Draw the portion of state space tree generated by LCBB for the knapsack
instances: n = 4; (P1; P2;P3 ; P4) = (10; 10; 12; 18); (w1w2;w3;w4) = (2;4; 6; 9 )
and M = 15
(c)I) Let w = {6; 15; 20; 10; 11; 18; 29} and m=35. Find all possible subsets of w
that sum to m. Draw the portion of the state space tree that is generated. (II)
Differentiate between Live node and E-node.
(d)Construct an optimal binary search tree for the following data: n=4,
(a1,a2,a3,a4)= ( do, if, int, while), p(1:4)= ( 3,3,1,1) and q(0:4)= ( 2,3,1,1,1).
(e)Find an optimal solution to the 0/1 knapsack instance, given n=3, weights and
profits as (w1,w2,w3)=(2,3,4) , p1,p2,p3)= (1,2,5) and knapsack capacity =6
generate the sets Si using dynamic programming.

4. (g)Draw the portion of state space tree generated by LCBB for the knapsack instances: n = 4.1. 6. BHARAT INSTITUTE OF ENGINEERING & TECHNOLOGY B. 12. 11. Find all possible subsets of w that sum to m. (b)Draw the portion of state space tree generated by LCBB for the knapsack instances: n = 4. (w1w2. (II) Differentiate between Live node and E-node. (d)Find an optimal solution to the 0/1 knapsack instance.1).4) . (II) Differentiate between Live node and E-node. P4) = (10. (j)E0. 9 ) and M = 15 (h)I) Let w = {6.a2. if.P3 . (a1. P2.w3)=(2.3. 10.1.BHARAT INSTITUTE OF ENGINEERING & TECHNOLOGY B. 15.1.w3.a3.4.4. 18. 9 ) and M = 15 (c)I) Let w = {6.a3. 18). 11. int. 20.1) and q(0:4)= ( 2.3. while). 15. P2. 10. 12.2015 FN Answer any two Max.p3)= (1. . 18). while).w4) = (2.1). given n=3. if. 10.w4) = (2. 29} and m=35. p1.p3)= (1.3.w2. weights and profits as (w1.w2.3.1) and q(0:4)= ( 2.a4)= ( do.w3)=(2.2.5) and knapsack capacity =6 generate the sets Si using dynamic programming. (e)Explain N-Queens Problem. given n=3. (P1.1. p1.3. weights and profits as (w1.2015 FN Answer any two Max. Draw the portion of the state space tree that is generated. 29} and m=35.P3 . Draw the portion of the state space tree that is generated.4) . 20.1. p(1:4)= ( 3. Marks: 10 Set-4 (f)Construct an optimal binary search tree for the following data: n=4.a2.p2. int.5) and knapsack capacity =6 generate the sets Si using dynamic programming.p2. P4) = (10.a4)= ( do. 6. (a1.2. 10.1. (w1w2.w3.3.Tech II year II SEM – MID-II EXAMINATION BRANCH: II CSE A SUBJECT: Design and analysis of Algorithms Date: . 18. (i)Find an optimal solution to the 0/1 knapsack instance. Marks: 10 Set-3 (a)Construct an optimal binary search tree for the following data: n=4.4.Tech II year II SEM – MID-II EXAMINATION BRANCH: II CSE A SUBJECT: Design and analysis of Algorithms Date: . p(1:4)= ( 3. (P1.0xplain N-Queens Problem. Find all possible subsets of w that sum to m.

Sign up to vote on this title
UsefulNot useful