JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2018 DATA STRUCTURES AND ALGORITHMS Previous Question Paper (June/July - 2018 - R13)

MCA | 2018 | II | R13 | June/July - 2018

Answer PaperPaper Code: 812AFMaximum Marks: 60Time: 3 Hours

Part A is compulsory which carries 20 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit. Each question carries 8 marks and may have a, b, c as sub questions.

Part A

120 marks
a

Write a procedure to convert infix expression to postfix expression. Apply the procedure on the following ((A+B)*D) ↑ (E-F)

4 marks

Answer

To convert infix to postfix, use a stack to hold operators. Scan the expression from left to right: if an operand is encountered, append it to the result; if an operator is encountered, pop operators from the stack with higher or equal precedence to the result before pushing the current operator; use parentheses to control precedence. For ((A+B)*D) ↑ (E-F):

  1. ( ( A + B ) * D ) ↑ ( E - F )
  2. Postfix: AB+D*EF-↑
b

Define Binary tree. Write an algorithm to insert an element in to a binary tree.

4 marks

Answer

A Binary Tree is a non-linear data structure where each node has at most two children, referred to as the left child and the right child. To insert an element into a binary tree (typically a binary search tree):

  1. If the tree is empty, create a new node as the root.
  2. If the value is less than the current node's value, move to the left subtree.
  3. If the value is greater than the current node's value, move to the right subtree.
  4. Repeat until an empty spot is found and insert the new node there.
c

Write the principle of(i) Quick sort (ii) Merge sort and write their complexities.

4 marks

Answer

Sign in to view the complete answer paper.

d

Construct an AVL Tree by inserting numbers from 1 to 8.

4 marks

Answer

Sign in to view the complete answer paper.

e

Explain Kruskal’s Algorithm for Minimum cost spanning trees.

4 marks

Answer

Sign in to view the complete answer paper.

Part B

2

What is meant by stack? Write push and pop functions in C++ using an array.

8 marks

Answer

Sign in to view the complete answer paper.

OR
38 marks
a

Write a short note on Linked List. What the various applications of linked list?

4 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm for deleting an element from the linked list.

4 marks

Answer

Sign in to view the complete answer paper.

4

With a neat sketch explain DFS and BFS traversals with an example.

8 marks

Answer

Sign in to view the complete answer paper.

OR
5

Explain Binary tree ADT and its representation in Array and Linked lists.

8 marks

Answer

Sign in to view the complete answer paper.

6

Suppose a sequence of numbers is given like: 5, 1, 6, 7, 9, 22, 10, 55, 45, and 34. How this numbers will be sorted using a) Insertion Sort b) Bubble sort.

8 marks

Answer

Sign in to view the complete answer paper.

OR
7

Write an algorithm for linear search and Binary Search and compare them in terms of time complexity.

8 marks

Answer

Sign in to view the complete answer paper.

8

Explain in detail about Red-Black trees and Splay trees with examples.

8 marks

Answer

Sign in to view the complete answer paper.

OR
98 marks
a

Show the result of inserting 3, 1, 4, 6, 9, 2, 5, 7 into an initially empty binary search tree.

4 marks

Answer

Sign in to view the complete answer paper.

b

Show the result of deleting the root.

4 marks

Answer

Sign in to view the complete answer paper.

10

Discuss about Job Sequencing with deadlines and Single Source Shortest path problem.

8 marks

Answer

Sign in to view the complete answer paper.

OR
11

Explain the Pattern matching algorithm with an example.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of DATA STRUCTURES AND ALGORITHMS from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for MCA 2018 II, June/July - 2018, R13.

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

Other papers in DATA STRUCTURES AND ALGORITHMS

Loading Question Papers

Fetching data from database...