daa sem 4
daa sem 4
daa sem 4
2 0
6. No sheet should be left blank. Any written material after a blank sheet will not be
evaluated/checked.
A Y 20
1-a.
(a) backtracking
. M
Merge sort uses which of the following technique to implement sorting? (CO1) 1
E G
(b) greedy algorithm
(c) dynamic programming
1-b.
R
(d) divide and conquer
(a) O(n)
(b) O(log n)
(c) O(nlog n)
(d) O(n2)
1-c. What is the special property of red-black trees and what root should always 1
be? (CO2)
(a) color which is either red or black and root should always be black color
only
.
Page 1 of 4
.
(b) height of the tree
(c) pointer to next node
(d) a color which is either green or black
(a) n2
(b) n3
(c) kci
(d) 2k
(a) O(V lg E)
(b) O(E+V)
(c) O(lg V)
1-f.
(d) O(E lg E)
. M
Depth First Search is equivalent to which of the traversal in the Binary Trees? 1
G
(a) Pre-order Traversal
(b) Post-order Traversal
R E
(c) Level-order Traversal
(d) In-order Traversal
(a) Hashing
(b) Sorting
(c) Augmenting
.
Page 2 of 4
.
(d) Dynamic Programming
2 4 30
3-a.
3-b.
Explain asymptotic notations with example.(CO1)
2 0
Solve the following recurrence relation using master's theorem (CO1)
6
3-c.
T(n) = 7T(n/2) + 3n2 + 2
A Y
Insert the nodes 15, 13, 12, 16, 19, 23, 5, 8 into empty Red Black Tree (CO2) 6
3-d.
example for the same. (CO2)
. M
Explain the algorithm to delete a given element in a binomial Heap. Give an 6
3.e.
EG
Write algorithm to solve fractional knapsack problem. For the given items find
the optimal solution: I:, W: <60, 20, 40, 30, 50>, P: <120, 100, 90, 90, 50>,
capacity of knapsack = 100. (CO3)
6
3.f.
R
Write an algorithm of Sum-of-subset problem using backtracking approach.
Find all possible solution for following instances using same if m=30 and S=<
6
1,2,5,7,8,10,15,20,25>. (CO4)
SECTION C 50
5-a. Write algorithm for extracting minimum element in a fibonacci heap. Also give 10
example? (CO2)
5-b. Insert the following element in an initially empty RB-Tree. 12, 9, 81, 76, 23, 43, 10
65, 88, 76, 32, 54. Now Delete 23 and 81. (CO2)
6-b. How Divide and Conquer technique is used to solve a problem efficiently? 10
Explain the use of pivot element in Quick sort. Write the algorithm for quick
sort.
2 0
Explain 8 queen problem. Make a state space tree and find the solution for 8
queens problem.(CO4)
10
7-b.
A Y
Solve the instance of 0/1 knapsack problem using dynamic Programming : n =
4, M = 25, (P1, P2, P3 P4) = (10, 12, 14, 16), (W1, W2, W3, W4) = (9, 8, 12, 14).
(CO4)
10
. M
G
8-a. Discuss in detail about the class P, NP, NP-hard and NP-complete problems. 10
Give examples for each class. (CO5)
8-b.
R E
Explain the string matching algorithm for finding the pattern on a text and
analyze the algorithm. (CO5)
10
.
Page 4 of 4