Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech II DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (March - 2022 - R13)

B.Tech | II | II | R13 | March - 2022

Answer PaperPaper Code: 114CSMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Write about the pseudocode conventions for representing algorithm.

8 marks

Answer

Pseudocode is a high-level description of an algorithm that uses a mixture of natural language and programming constructs to convey the logic without adhering to the strict syntax of a specific language. The common conventions used include:

  • Control Structures: Standard constructs like if-then-else, while, for, and repeat-until are used to manage flow.
  • Assignment: The assignment operator is represented by the symbol ← (e.g., x ← y + z).
  • Indexing: Arrays are typically indexed using square brackets, such as A[i], where the index can be a variable or expression.
  • Method Calls: Procedures are invoked by name, with parameters passed by value or reference.
  • Comments: Comments are usually indicated by double slashes (//) or specific delimiters to explain the purpose of blocks of code.
  • Indentation: Block structure is defined by indentation rather than braces or keywords like 'begin' and 'end'.
  • Data Types: Variables are not explicitly declared with types, as the focus is on the algorithmic logic rather than implementation details.
b

Explain about Binary search and derive the time complexity.

7 marks

Answer

Binary search is an efficient divide-and-conquer algorithm used to find the position of a target value within a sorted array. It works by repeatedly dividing the search interval in half. If the target value is less than the item in the middle of the interval, the search continues in the lower half; otherwise, it continues in the upper half.

The time complexity is derived as follows:

  • In each step, the algorithm compares the target with the middle element and discards half of the remaining elements.
  • Let T(n) be the time taken for an array of size n. The recurrence relation is:
T(n) = T(n/2) + 1
  • Using the Master Theorem or repeated substitution, where T(1) = 1:
  • T(n) = T(n/2) + 1
  • T(n) = (T(n/4) + 1) + 1 = T(n/4) + 2
  • T(n) = T(n/2^k) + k
  • Setting n/2^k = 1, we get k = log_2(n).
  • Therefore, T(n) = T(1) + log_2(n), which results in a time complexity of O(log n).
215 marks
a

Illustrate on Asymptotic Notations.

7 marks

Answer

Sign in to view the complete answer paper.

b

Give the algorithm for Quick Sort.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Explain about Depth first Graph Traversals with an example and derive the time complexity.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain AND/OR Graphs.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Explain in detail about the binary tree traversal algorithm.

8 marks

Answer

Sign in to view the complete answer paper.

b

What is a disjoint set? Give the representations for disjoint sets and explain simple find and simple union operations.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain job sequencing with deadlines using an example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss 0/1 knapsack problem using dynamic programming.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain about the Optimal Binary Search Trees using dynamic programming.

8 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about all pairs of shortest path problem.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Give general method for Branch and Bound and compare with backtracking.

8 marks

Answer

Sign in to view the complete answer paper.

b

Give backtracking solution to sum of subsets problem.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write notes on NP-hard and NP-complete problems.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain cook’s theorem.

7 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 Jawaharlal Nehru Technological University Hyderabad for B.Tech CSE II II, March - 2022, R13.

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...