JNTU

JNTU B.Tech II DESIGN AND ANALYSIS OF ALGORITHMS Previous Question Paper (November/December - 2020 - R15)

B.Tech | II | II-II | R15 | November/December - 2020

Answer PaperPaper Code: 124CTMaximum Marks: 75Time: 2 Hours

Answer any Five Questions. All Questions Carry Equal Marks.

Main

1

Explain how divide and conquer method is used to perform merger sort with a suitable example.

15 marks

Answer

The Merge Sort algorithm is a classic application of the Divide and Conquer paradigm. It works by recursively splitting an array into two halves until each sub-array contains a single element, then merging these sub-arrays in sorted order.

The process follows three distinct phases:

  • Divide: The algorithm finds the midpoint of the current array and splits it into two equal halves. This step repeats until the base case is reached (a sub-array of size 1).
  • Conquer: The sub-arrays are sorted recursively. Since a single-element array is inherently sorted, the base case requires no further action.
  • Combine (Merge): The sorted sub-arrays are merged back together. During this step, the algorithm compares elements from both sub-arrays and places the smaller element into a temporary array, ensuring the resulting merged array is sorted.

Consider the example array: [38, 27, 43, 3].

  1. Divide: Split into [38, 27] and [43, 3]. Split further into [38], [27], [43], and [3].
  2. Merge: Compare 38 and 27 to form [27, 38]. Compare 43 and 3 to form [3, 43].
  3. Final Merge: Compare the sorted sub-arrays [27, 38] and [3, 43]. Compare 27 and 3 (take 3), compare 27 and 43 (take 27), compare 38 and 43 (take 38), and finally take 43. The result is [3, 27, 38, 43].

Merge Sort has a time complexity of O(n log n) in all cases (best, average, and worst), making it highly efficient for large datasets, though it requires O(n) auxiliary space for the merging process.

2

Explain in detail how Greedy method is used to solve Job sequencing with deadlines problem.

15 marks

Answer

The Job Sequencing with Deadlines problem involves a set of n jobs, where each job i has a deadline di and a profit pi. Each job takes one unit of time to complete, and only one job can be processed at a time. The goal is to maximize the total profit by scheduling jobs such that each job completes on or before its deadline.

The Greedy approach is used to solve this problem by prioritizing jobs with the highest profit. The algorithm follows these steps:

  1. Sort all given jobs in non-increasing order of their profit values.
  2. Initialize a schedule array (or time slot array) of size equal to the maximum deadline among all jobs, initially marked as empty.
  3. Iterate through the sorted jobs. For each job, attempt to schedule it in the latest possible free time slot that is less than or equal to its deadline.
  4. If a slot is available, assign the job to that slot and add its profit to the total. If no slot is available before the deadline, discard the job.

This strategy works because it makes a locally optimal choice at each step by picking the most profitable job available, which leads to a globally optimal solution for this specific problem structure. The time complexity of this approach is O(n log n) due to sorting, and the space complexity is O(n) to store the schedule.

315 marks
a

What is dynamic programming? Explain.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about Multistage graphs with an example.

8 marks

Answer

Sign in to view the complete answer paper.

4

Explain in detail about how 8-queens problem is solved using backtracking.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain in detail about Cook’s theorem.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss with an example NP- Complete problem.

8 marks

Answer

Sign in to view the complete answer paper.

6

Explain Quick sort with suitable example.

15 marks

Answer

Sign in to view the complete answer paper.

7

Discuss about Single source shortest path problem with an example.

15 marks

Answer

Sign in to view the complete answer paper.

8

Discuss in detail about optimal binary search trees.

15 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 IT II II-II, November/December - 2020, R15.

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