Vel Tech High Tech: Reg. No. Question Paper Code

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Question Paper Code A12406 Reg. No.

Vel Tech High Tech


Dr.Rangarajan Dr.Sakunthala Engineering College
An Autonomous Institution

B.E / B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2021


Fourth Semester
Computer Science and Engineering
CS8451 - DESIGN AND ANALYSIS OF ALGORITHM
(Regulations 2017)
Time : 3 Hours Max. Marks 100
Answer ALL Questions
PART-A (10 x 2 = 20 Marks)
1. Find the recurrence relation for the following equation
T(n) = 2T([√ ])+ 1, T(1) = 1.
2. What is the time, space complexity of following code:
int a = 0, b = 0;
for (i = 0; i < N; i++)
{
a = a + rand();
}
for (j = 0; j < M; j++)
{
b = b + rand();
}
3. In quick sort for sorting n elements the (n/4)th smallest element is selected as pivot using
O(n) time algorithm. What is the worst case time complexity of quick sort?
4. Compare Linear search and binary search techniques.

5. Define optimality.

6. List out the advantages of dynamic programming.

7. What do you mean by ‘perfect matching’ in bipartite graphs?

8. Define flow cut.

9. What are the applications of back tracking technique?


10. Define P and NP problems.

PART – B (5 x 13 = 65 Marks)
11. a) Illustrate the steps that need to be followed while designing and analyzing an (13)
algorithm.
(Or)
b) Explain the procedures involved in mathematical analysis for recursive algorithms and (13)
do the same for finding the factorial of a number.

12. a) Solve the travelling salesman problem by exhaustive search and give the optimal (13)
solution for the given graph.

(Or)
b) Explain the merge sort algorithm with example and give the recurrence relation and (13)
efficiency.

13. a) Solve the knapsack problem using dynamic programming approach for the given data. (13)
The capacity of the knapsack is w=5.
Item Weight Value
1 2 3
2 3 4
3 4 5
4 5 6
(Or)
b) Explain Kruskals’s algorithm with example and analyze the efficiency. (13)

14. a) State and prove max-flow min-cut theorem. (13)


(Or)
b) Explain the stable marriage algorithm and trace it with an instance. Analyze its running (13)
time complexity.
15. a) Demonstrate the back tracking solutions to solve 8-queens problem. (13)
(Or)
b) Explain the assignment problem using branch and bound with example. (13)

PART C (1 x 15 = 15 Marks)
16. a) Let A= {l/119, m/96, c/247, g/283, h/72, f/77, k/92, j/19} be the letters and its (15)
frequency of distribution in a text file. Analyze a suitable Huffman coding to compress
the data.
(Or)
b) There are 4 people who need to be assigned to execute 4 jobs (one person per job) and (15)
the problem is to find an assignment with the minimum total cost. The assignment cost
is given below, solve the assignment problem by exhaustive search.
Job1 Job2 Job3 Job4
Person 1 9 2 7 8
Person 2 6 4 3 7
Person 3 5 8 1 8
Person 4 7 6 9 4

*****

You might also like