JNTU

JNTU B.Tech III DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (October - 2020 - R16)

B.Tech | III | I | R16 | October - 2020

Answer PaperPaper Code: 135AFMaximum Marks: 75Time: 2 hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Explain the general method of divide and conquer with an example.

7 marks

Answer

The Divide and Conquer paradigm is an algorithmic strategy that solves a problem by recursively breaking it down into two or more sub-problems of the same type, until these become simple enough to be solved directly. The solutions to the sub-problems are then combined to give the solution to the original problem.

The general method follows three steps:

  1. Divide: Break the problem into smaller sub-problems that are instances of the same problem.
  2. Conquer: Solve the sub-problems recursively. If the sub-problems are small enough, solve them as base cases.
  3. Combine: Merge the solutions of the sub-problems to obtain the final solution for the original problem.

An example is Merge Sort. To sort an array of size n, it divides the array into two halves, recursively sorts each half, and then merges the two sorted halves into a single sorted array.

b

Write an algorithm for Strassen's matrix multiplication and analyze the complexity of your algorithm.

8 marks

Answer

Strassen's algorithm improves matrix multiplication by reducing the number of recursive multiplications required. Given two n x n matrices A and B, we divide them into four n/2 x n/2 sub-matrices. The algorithm computes seven products P1 through P7:

P1 = (A11 + A22)(B11 + B22)
P2 = (A21 + A22)B11
P3 = A11(B12 - B22)
P4 = A22(B21 - B11)
P5 = (A11 + A12)B22
P6 = (A21 - A11)(B11 + B12)
P7 = (A12 - A22)(B21 + B22)

The resulting sub-matrices of C are then calculated using additions and subtractions of these products:

C11 = P1 + P4 - P5 + P7
C12 = P3 + P5
C21 = P2 + P4
C22 = P1 - P2 + P3 + P6

The recurrence relation for the time complexity is:

T(n) = 7T(n/2) + O(n²)

Using the Master Theorem, where a = 7, b = 2, and f(n) = O(n²), we compare log base 2 of 7 (≈ 2.81) with 2. Since 2.81 > 2, the time complexity is O(n^log₂7), which is approximately O(n^2.81), making it more efficient than the standard O(n³) approach for large matrices.

215 marks
a

List the disjoint set operations and explain with examples.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain GRAPH coloring problem with example. Analyze the running time for that problem/algorithm.

8 marks

Answer

Sign in to view the complete answer paper.

3

Differentiate between Prim’s algorithm and Kruskal's algorithm for finding the minimum cost spanning tree.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write an algorithm of all pairs shortest path problem.

7 marks

Answer

Sign in to view the complete answer paper.

b

Solve the following 0/1 Knapsack problem using dynamic programming P= (11, 21, 31, 33), W= (2, 12, 23, 15), C=42, n=4.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Compare NP Hard and NP Complete.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about 0/1 Knapsack Problem using branch and bound with example.

8 marks

Answer

Sign in to view the complete answer paper.

6

Explain the merge sort algorithm with an example. Design an algorithm for merge sort.

15 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Explain the major drawbacks of backtracking method with example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm for sum of subsets problem.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write an algorithm for Knapsack problem using Greedy method.

7 marks

Answer

Sign in to view the complete answer paper.

b

Find the optimal solution by using Prim's minimum cost spanning of the following graph.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of DESIGN AND ANALYSIS OF ALGORITHMS from JNTU for B.Tech CSE III I, October - 2020, R16.

For the question paper without answers, switch to the Question Paper tab.

Other papers in DESIGN AND ANALYSIS OF ALGORITHMS

Loading Question Papers

Fetching data from database...