Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech III Year DATA STRUCTURES Previous Question Paper (March - 2024 - R16)

B.Tech | III Year | II Semester | R16 | March - 2024

Answer PaperPaper Code: 136EVMaximum Marks: 75Time: 3 Hours

Answer all questions from Part A. Answer any one question from each unit in Part B.

Part A

1.a

Define time complexity and space complexity.

2 marks

Answer

Time complexity is a measure of the amount of time an algorithm takes to run as a function of the length of the input. It is typically expressed using asymptotic notation, such as Big O notation, to describe the growth rate of the execution time relative to the input size.

Space complexity is a measure of the amount of working storage (memory) an algorithm requires as a function of the input size. It includes both the space for the input data and the auxiliary space used by the algorithm during its execution.

1.b

Represent the following sparse matrix as a linked list.

3 marks

Answer

A sparse matrix can be represented as a linked list by storing only the non-zero elements. Each node in the linked list contains four fields: row index, column index, value, and a pointer to the next non-zero element node. The list is typically headed by a header node that stores the total number of rows, total number of columns, and the total number of non-zero elements present in the matrix.

Node Structure: [Row | Col | Value | Next]

This representation is highly efficient in terms of memory usage because it avoids storing zero values, which are predominant in sparse matrices. The traversal of the matrix is performed by following the pointers from the head node through the sequence of non-zero nodes.

1.c

Write any four applications of stack.

2 marks

Answer

Sign in to view the complete answer paper.

1.d

Find the value of the given postfix expression AB+C*DE-F/+G+ where A = 3, B = 2, C = 5, D = 4, E = 6, F = 9, G=12.

3 marks

Answer

Sign in to view the complete answer paper.

1.e

Represent the following graph using adjacency matrix.

2 marks

Answer

Sign in to view the complete answer paper.

1.f

Represent the following binary tree using array.

3 marks

Answer

Sign in to view the complete answer paper.

1.g

What is collision? How collisions are handled in hashing?

2 marks

Answer

Sign in to view the complete answer paper.

1.h

How many comparisons are required using linear search and binary search to search the key 46 in the following elements? 12, 32, 34, 36, 40, 46, 50, 52, 53

3 marks

Answer

Sign in to view the complete answer paper.

1.i

Define Binary Search Tree and AVL Tree.

2 marks

Answer

Sign in to view the complete answer paper.

1.j

Write in-order, pre-order, post-order traversal sequences for the following binary search tree.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Write a function to insert an element at the end of the linked list.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm to insert an element at the front of circular linked list.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Write a function to add two sparse matrices.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a function to find GCD of two numbers using recursion.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

Write the program to implement operations of stack using arrays.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write the program to convert given infix expression into postfix expression.

5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

Write the program to implement operations of queue using linked list.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is deque (Double ended queue)? Explain insert and delete operations of deque.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Write a procedure to insert an element into max heap.

5 marks

Answer

Sign in to view the complete answer paper.

b

Define Graph. Write a function to traverse the graph using BFS.

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

Write a function to delete an element from binary tree.

5 marks

Answer

Sign in to view the complete answer paper.

b

Differentiate between DFS and BFS.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Create a hash table using the following values: 98, 73, 21, 58, 88, 14, 37, 77. The hash function is h(x) = x%7.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to implement insertion sort.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Use selection sort to sort the following elements: 23, 21, 11, 43, 32, 55, 2, 9. Show the array elements at each step.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to search for an element using binary search.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

Write a function to insert an element into a binary search tree.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain various rotations of the AVL tree.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

Write the process to insert and delete an element in B-Tree.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write an algorithm for The Knuth-Morris-Pratt algorithm.

5 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 from Jawaharlal Nehru Technological University Hyderabad for B.Tech CSE III Year II Semester, March - 2024, R16.

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

Other papers in DATA STRUCTURES

Loading Question Papers

Fetching data from database...