February 2023
February 2023
PART – A
H
(25 Marks)
PART – B
pe
(50 Marks)
2.a) Write an Iterative algorithm for binary search. What is its best case analysis?
rs
b) Write any five rules to define an algorithm. [5+5]
OR
3.a) What is an algorithms? List the properties of an algorithm.
b) Write the worst case analysis of quick sort with suitable example. [5+5]
20
4.a) Write the union and find algorithms.
b) Explain the 4-Queens problem. [5+5]
23
OR
5.a) Compare and contrast divide and conquer approach with dynamic programming.
b) Explain the sum of subset problem. [5+5]
6.a) Consider n=4 & (q1,q2,q3,q4)=(do, if, int, while) the values for p’s & q’s are given as
p(1:4)=(3,3,1,1) & q(0:4)=(2,3,1,1,1). Construct the Optimal Binary Search tree.
b) Define backtracking. List the advantages of it. [5+5]
OR
7.a) Write the general method for dynamic programming.
b) Find an Optimal Solution to the knapsack instance n=7, m=15,
(P1,P2…..P7)=(10,5,15,7, 6, 18,3) and (W1,W2…..W7)=(2,3,5,7,1,4,1). [5+5]
8.a) Find the minimum cost spanning tree for the following graph using kruskals algorithm.
JN
TU