JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III DATA STRUCTURES Previous Question Paper (August/September - 2024 - R16)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Write recursive algorithm to find factorial of a number.
Answer
The recursive algorithm for calculating the factorial of a non-negative integer n is defined by the base case where 0! = 1 and the recursive step where n! = n × (n - 1)! for n > 0.
if n == 0 return 1
else return n * Factorial(n - 1)
What is the space complexity of a program to insert an element into singly linked list?
Answer
The space complexity of inserting an element into a singly linked list is O(1), which represents constant space complexity. This is because the operation only requires the allocation of a single new node to store the data and a few pointer updates, regardless of the size of the existing list. No additional data structures or recursive calls that grow with the input size are needed.
What are the applications of stack?
Answer
Sign in to view the complete answer paper.
Convert the given infix expression to prefix and postfix expressions: a+b/(c*d/(e-f))
Answer
Sign in to view the complete answer paper.
What are properties of binary trees?
Answer
Sign in to view the complete answer paper.
Give an example for graph representation with adjacency matrix and adjacency list.
Answer
Sign in to view the complete answer paper.
How time complexity of binary search is less than linear search?
Answer
Sign in to view the complete answer paper.
What are the advantages and disadvantages of static hashing?
Answer
Sign in to view the complete answer paper.
What are splay trees? Give an example.
Answer
Sign in to view the complete answer paper.
What are the properties of an AVL Tree?
Answer
Sign in to view the complete answer paper.
Part B
What are singly linked lists? Write an algorithm for insertion and deletion operations in singly linked lists.
Answer
Sign in to view the complete answer paper.
Write an algorithm to multiply two matrices of n x m order and explain.
Answer
Sign in to view the complete answer paper.
What is a recursive algorithm? Write down the recursive algorithm to generate ‘n’ Fibonacci series.
Answer
Sign in to view the complete answer paper.
Write an algorithm to evaluate a postfix expression.
Answer
Sign in to view the complete answer paper.
Explain the basic operations performed on a stack.
Answer
Sign in to view the complete answer paper.
What are Circular queues? Write an algorithm to perform insertion and deletion operations on circular queue.
Answer
Sign in to view the complete answer paper.
What are binary tree traversals? Explain with examples and also state their applications.
Answer
Sign in to view the complete answer paper.
What is max heap? Write an algorithm to perform insertion and deletion operations from max heap.
Answer
Sign in to view the complete answer paper.
Explain selection sort method.
Answer
Sign in to view the complete answer paper.
With an algorithm and example, explain binary search technique.
Answer
Sign in to view the complete answer paper.
What are AVL trees? Write the pseudcode to perform insert and delete operations on AVL trees and explain.
Answer
Sign in to view the complete answer paper.
Explain insert and delete operations on B trees with example.
Answer
Sign in to view the complete answer paper.