JNTU

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

B.Tech | III | I | R16 | August - 2022

Answer PaperPaper Code: 135AFMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Explain about the types of Randomized algorithm.

7 marks

Answer

Randomized algorithms utilize a source of random bits to guide their execution, ensuring that the algorithm's behavior depends on both the input and the random choices made. They are primarily classified into two types:

  1. Las Vegas Algorithms: These algorithms always produce the correct result or inform the user about a failure. The randomness affects only the running time, not the correctness of the output. An example is Randomized QuickSort, where the choice of the pivot is random, but the sorted output is always correct.
  2. Monte Carlo Algorithms: These algorithms have a deterministic running time but a probability of producing an incorrect answer. The error probability can be reduced by running the algorithm multiple times or increasing the computational effort. An example is the Miller-Rabin primality test, which determines if a number is prime with a certain probability of error.
b

Write an algorithm of Quick sort and analyze performance of quick sort in worst case.

8 marks

Answer

The QuickSort algorithm follows a divide-and-conquer strategy by selecting a pivot element and partitioning the array such that elements smaller than the pivot are on the left and larger are on the right.

Algorithm:

QuickSort(A, low, high) {
  if (low < high) {
    p = Partition(A, low, high)
    QuickSort(A, low, p - 1)
    QuickSort(A, p + 1, high)
  }
}

In the worst-case scenario, the partition process consistently results in highly unbalanced splits, such as when the pivot is always the smallest or largest element in the array (e.g., sorting an already sorted array with the first or last element as the pivot). This leads to a recursion tree of depth n, where n is the number of elements.

The recurrence relation for the worst case is:

T(n) = T(n - 1) + T(0) + Θ(n)

This simplifies to:

T(n) = T(n - 1) + Θ(n)

Summing this series results in T(n) = Θ(n²). Thus, the worst-case time complexity of QuickSort is quadratic.

215 marks
a

What are asymptotic notations? Explain with examples.

7 marks

Answer

Sign in to view the complete answer paper.

b

Sort the following elements using Merge sort: 12, 2, 16, 30, 8, 28, 4, 10, 20, 6, 18

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Explain the Union algorithm with weighing rule.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about the general method of backtracking.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write an algorithm to determine Bi-connected components.

7 marks

Answer

Sign in to view the complete answer paper.

b

Describe sum of subsets problem with an example.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Show how Prim’s algorithm can be implemented using heap. What would be the time complexity of the algorithm?

10 marks

Answer

Sign in to view the complete answer paper.

b

Write the applications of Greedy method.

5 marks

Answer

Sign in to view the complete answer paper.

6

Write the Greedy algorithm for sequencing unit time jobs with deadlines and profits. Trace the algorithm with suitable example.

15 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Use the function OBST to compute w(i, j), r(i, j), and c(i, j), 0 ≤ i < j ≤ 4, for the identifier set (a1,a2,a3,a4) = (cout, float, if, while) with p(1) = 1/20, p(2) = 1/5, p(3) = 1/10, p(4) = 1/20, q(0) = 1/5, q(1) = 1/10, q(2) = 1/5, q(3) = 1/20, and q(4) = 1/20. Using the r(i, j)’s construct the optimal binary search tree.

10 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about chained matrix multiplication in dynamic programming.

5 marks

Answer

Sign in to view the complete answer paper.

8

Explain the following:

15 marks
a

LC branch and bound

8 marks

Answer

Sign in to view the complete answer paper.

b

Cook’s theorem.

7 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, August - 2022, 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...