JNTU

JNTU B.Tech III DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (January/February - 2023 - R16)

B.Tech | III | I | R16 | January/February - 2023

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

Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.

Part A

1a

Define Big ‘Oh’ notation.

2 marks

Answer

Big 'Oh' notation, denoted as O(g(n)), represents the asymptotic upper bound of a function. A function f(n) belongs to O(g(n)) if there exist positive constants c and n0 such that 0 ≤ f(n) ≤ c · g(n) for all n ≥ n0. It describes the worst-case time complexity of an algorithm, providing an upper limit on the growth rate of the running time as the input size n increases.

1b

Compare Quick Sort and Merge Sort.

3 marks

Answer

Quick Sort and Merge Sort are both divide-and-conquer algorithms, but they differ significantly in their approach and performance characteristics:

  • Strategy: Quick Sort uses a pivot-based partitioning strategy, sorting the array in-place by rearranging elements around the pivot. Merge Sort uses a recursive divide-and-conquer strategy, splitting the array into halves, sorting them, and then merging the sorted sub-arrays.
  • Time Complexity: Quick Sort has an average-case time complexity of O(n log n) but a worst-case of O(n²), which occurs when the pivot selection is poor. Merge Sort guarantees O(n log n) time complexity in all cases (best, average, and worst).
  • Space Complexity: Quick Sort is an in-place algorithm requiring O(log n) auxiliary space for the recursion stack. Merge Sort is not in-place and typically requires O(n) auxiliary space to store the temporary sub-arrays during the merge process.
  • Stability: Merge Sort is a stable sorting algorithm, meaning it preserves the relative order of equal elements. Quick Sort is generally considered unstable.
1c

What is an articulation point in a graph? Give an example.

2 marks

Answer

Sign in to view the complete answer paper.

1d

Construct the state space tree for 4-Queens problem with bounding function.

3 marks

Answer

Sign in to view the complete answer paper.

1e

Write an algorithm for simple Union operation.

2 marks

Answer

Sign in to view the complete answer paper.

1f

What is Minimum Spanning Tree? Give an example.

3 marks

Answer

Sign in to view the complete answer paper.

1g

Write the difference between the Dynamic programming and the Greedy method.

2 marks

Answer

Sign in to view the complete answer paper.

1h

What is mean by state space tree? Give an example.

3 marks

Answer

Sign in to view the complete answer paper.

1i

Define cook’s theorem.

2 marks

Answer

Sign in to view the complete answer paper.

1j

Draw the relation of P, NP, NP-Hard and NP-Complete.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Sort the following data using Quick Sort and illustrate each step with appropriate figure for each iteration. [ 20, 12, 35, 15, 11, 19, 35 ]

5 marks

Answer

Sign in to view the complete answer paper.

b

Write the Recurrence relation and derive the best case complexity for the Quick Sort.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Describe asymptotic notations Big Oh (O), Omega (Ω) and Theta (Ɵ) notations and show their behavior using graphical representation.

5 marks

Answer

Sign in to view the complete answer paper.

b

Give the asymptotic bounds for the equation

f(n)=2n3-6n+30
and represent in terms of Ɵ notation.

5 marks

Answer

Sign in to view the complete answer paper.

4

Generate the state space tree and find the solutions for the subset sum for N=7, m=35, w={5,7,10,12,15,18,20} using back tracking approach.

10 marks

Answer

Sign in to view the complete answer paper.

OR
5

Write an algorithm for Graph Coloring problem and explain with an example.

10 marks

Answer

Sign in to view the complete answer paper.

6

Explain the concept of minimum cost spanning tree? What are the different algorithms exist for obtaining minimum cost spanning tree. Compute the minimum cost spanning tree using Prim’s algorithm for the given graph. Draw the spanning tree generated at each step.

10 marks

Answer

Sign in to view the complete answer paper.

OR
7

Write greedy algorithm for knapsack problem. Find the solution for the following Knapsack problem using greedy method. (p1,p2,p3,p4)=(2,5,8,1), (w1,w2,w3,w4)=(10,15,6,9) and m=30.

10 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Write an algorithm for all pairs shortest path. Define its complexity.

5 marks

Answer

Sign in to view the complete answer paper.

b

Compute the shortest distance between each pair of nodes for the following graph using all pair shortest path algorithm.

5 marks

Answer

Sign in to view the complete answer paper.

OR
9

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)=(do, if, int, while) with p(1:4)=(3,3,1,1) and q(0:4)=(2,3,1,1,1) using r(i,j)’s construct optimal binary search tree.

10 marks

Answer

Sign in to view the complete answer paper.

10

Generate the state space tree using FIFO Branch and Bound and find the shortest path followed by the travelling salesperson instance defined by the cost matrix given below.

10 marks

Answer

Sign in to view the complete answer paper.

OR
11

Explain circuit satisfiability problem with a circuit diagram. Show that circuit satisfiability problem is NP- hard.

10 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of DESIGN AND ANALYSIS OF ALGORITHMS from JNTU for B.Tech CSE(IoT) III I, January/February - 2023, R16.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in DESIGN AND ANALYSIS OF ALGORITHMS

Loading Question Papers

Fetching data from database...