JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III ALGORITHM DESIGN AND ANALYSIS Previous Question Paper (August - 2022 - R18)

B.Tech | III | III-II | R18 | August - 2022

Answer PaperPaper Code: 156ADMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Write a detailed note on Performance Analysis of Algorithms.

6 marks

Answer

Performance analysis is the process of determining the resources required by an algorithm to complete its execution. It primarily focuses on two metrics: Space Complexity and Time Complexity.

Space complexity represents the amount of memory an algorithm needs to run to completion. It consists of a fixed part (constant space for variables, constants, and instructions) and a variable part (dynamic memory allocation, recursion stack space). It is expressed as S(P) = C + S_p(n).

Time complexity represents the amount of computer time required by an algorithm to run to completion. It is analyzed by counting the frequency of operations, specifically the basic operations that dominate the execution time. It is expressed as T(P) = C + T_p(n). Performance analysis is typically evaluated using asymptotic notations like Big O, Omega, and Theta to describe the growth rate of resource consumption as the input size n increases.

b

Explain the implementation of Quick Sort with an example.

9 marks

Answer

Quick Sort is a divide-and-conquer algorithm that picks an element as a pivot and partitions the array around it. The process involves selecting a pivot, reordering the array so that elements smaller than the pivot are on the left and larger are on the right, and recursively sorting the sub-arrays.

Steps for implementation:

  1. Choose an element as the pivot (e.g., the last element).
  2. Partition the array: maintain two pointers, i and j, to swap elements such that all elements less than the pivot move to the left side.
  3. Place the pivot in its correct sorted position.
  4. Recursively apply the same logic to the left and right sub-arrays.

Example: Consider the array [24, 9, 29, 14, 19].

  1. Select 19 as the pivot.
  2. Partitioning: Compare 24, 9, 29, 14 with 19. After swapping, the array becomes [14, 9, 19, 29, 24].
  3. 19 is now in its sorted position.
  4. Recursively sort [14, 9] and [29, 24].
  5. Result: [9, 14, 19, 24, 29].

The average time complexity is O(n log n), while the worst-case complexity is O(n^2) when the pivot selection is poor (e.g., already sorted array).

215 marks
a

What is Divide and Conquer Technique? Explain its Applications.

6 marks

Answer

Sign in to view the complete answer paper.

b

Explain the implementation of Binary Search with an example.

9 marks

Answer

Sign in to view the complete answer paper.

3

What is n-queens problem? Explain in detail how it is solved using Backtracking technique?

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

List out the applications of Backtracking techniques.

6 marks

Answer

Sign in to view the complete answer paper.

b

Explain how sum of subsets problem is solved using Backtracking.

9 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

List out the applications of Dynamic Programming.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain in detail optimal binary search trees.

10 marks

Answer

Sign in to view the complete answer paper.

6

Explain with an example how all pairs shortest path problem is solved using Dynamic Programming.

15 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Write a short note on Job sequencing with deadlines.

6 marks

Answer

Sign in to view the complete answer paper.

b

Explain in detail how knapsack problem is solved using Greedy Technique?

9 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write a brief note on LC Branch and Bound.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain in detail about non deterministic algorithms.

5 marks

Answer

Sign in to view the complete answer paper.

c

Discuss about Cook’s theorem.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of ALGORITHM DESIGN AND ANALYSIS from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech IT III III-II, August - 2022, R18.

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

Other papers in ALGORITHM DESIGN AND ANALYSIS

Loading Question Papers

Fetching data from database...