Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad MCA 2020 DATA STRUCTURES AND ALGORITHMS Previous Question Paper (October/ November - 2020 - R17)

MCA | 2020 | II | R17 | October/ November - 2020

Answer PaperPaper Code: 842AAMaximum Marks: 75Time: 2 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Write an algorithm to implement Merge sort applying Divide and Conquer method.

7 marks

Answer

Merge sort follows the divide and conquer paradigm by recursively splitting an array into halves until individual elements remain, then merging them in sorted order.

  1. Divide: Find the midpoint m = (left + right) / 2.
  2. Conquer: Recursively call MergeSort for the left subarray (left to m) and the right subarray (m + 1 to right).
  3. Combine: Merge the two sorted subarrays into a single sorted array using a temporary array.

Algorithm MergeSort(A, left, right):

if left < right:
    mid = (left + right) / 2
    MergeSort(A, left, mid)
    MergeSort(A, mid + 1, right)
    Merge(A, left, mid, right)
b

Apply Merge Sort to sort the following elements in the ascending order: 20, 12, 14, 85, 94, 45, 74, 33, 25, 67.

8 marks

Answer

To sort the list [20, 12, 14, 85, 94, 45, 74, 33, 25, 67], we divide recursively:

1. Split into [20, 12, 14, 85, 94] and [45, 74, 33, 25, 67].

2. Further split until single elements: [20], [12], [14], [85], [94], [45], [74], [33], [25], [67].

3. Merge pairs:

  • [12, 20], [14, 85], [94], [45, 74], [25, 33], [67]
  • [12, 14, 20, 85], [45, 94], [25, 33, 67, 74]
  • [12, 14, 20, 45, 85, 94], [25, 33, 67, 74]
  • Final Merge: [12, 14, 20, 25, 33, 45, 67, 74, 85, 94]

The sorted list is: 12, 14, 20, 25, 33, 45, 67, 74, 85, 94.

2

Write an algorithm for Prim’s algorithm to find minimum cost spanning tree.

15 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Write the General method for Backtracking design method.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm to N-Queens problem and explain with an example of considering 4*4 chess board.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write an algorithm for Insertion sort technique and apply it for arranging the following elements in ascending order: 25, 77, 88, 54, 96, 32, 14, 59, 64.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write algorithms to implement Skip lists operations: insertion and deletion.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Define a Binary Tree and write the applications of binary trees.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm for Depth First Search (DFS) traversal of a graph and give an example.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain Strassen’s matrix multiplication.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm for Binary search. Give its time complexity analysis.

8 marks

Answer

Sign in to view the complete answer paper.

7

Let n=5, (p1…..p5) = (20, 15, 10, 5, 1) and (d1…d5) = (2, 2, 1, 3, 3). Find out an optimal solution for given job sequence with deadlines problem using Greedy method.

15 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write the General method for Dynamic programming.

7 marks

Answer

Sign in to view the complete answer paper.

b

Let n=4 and {a1, a2, a3, a4} = {do, if, int, while}. Let p[1…4]={3, 3, 1, 1} and q[0..4]={2,3,1,1,1} construct the optimal binary search tree.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of DATA STRUCTURES AND ALGORITHMS from Jawaharlal Nehru Technological University Hyderabad for MCA 2020 II, October/ November - 2020, R17.

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

Other papers in DATA STRUCTURES AND ALGORITHMS

Loading Question Papers

Fetching data from database...