Data Structure Prvious Paper
Data Structure Prvious Paper
Roll. No:
SECTION A 20
1-a. What is the time complexity of insertion sort & selection sort? (CO1) 1
1-b. Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the values of 1
arr[mid] generated in the first and second iterations of binary search? (CO1)
(a) 90 and 99
(b) 90 and 100
(c) 89 and 94
(d) 94 and 99
1-c. A data structure in which elements can be inserted or deleted at/from both ends but not in the 1
middle is? (CO2)
(a) Queue
Page 1 of 4
(b) Circular queue
(c) Dequeue
(d) Priority queue
1-d. If the MAX_SIZE is the size of the array used in the implementation of circular queue, array 1
index starts with 0, front points to the first element in the queue, and rear points to the last
element in the queue. Which of the following condition specify that circular queue is FULL?
(CO2)
(a) Front=rear= -1
(b) Front=(rear+1)%MAX_SIZE
(c) Rear=front+1
(d) Rear=(front+1)%MAX_SIZE
1-f. Linked lists are not suitable for the implementation of ___________ (CO3) 1
1-g. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. 1
Which one of the following is the post-order traversal sequence of the same tree? (CO4)
1-h. Which of the following tree data structures is not a balanced binary tree? (CO4) 1
Page 2 of 4
1-i. For a given graph G having v vertices and e edges which is connected and has no cycles, 1
which of the following statements is true? (CO5)
(a) v = e
(b) v = e+1
(c) v + 1 = e
(d) v = e-1
1-j. What is the maximum number of edges present in a simple directed graph with 7 vertices if 1
there exists no cycles in the graph? (CO5)
(a) 21
(b) 7
(c) 6
(d) 49
SECTION B 30
3-b. A hash table contains 7 buckets and uses linear probing to solve collision. The key values are 6
integers and the hash function used is key%7. Draw the table that, results after inserting in
the given order the following values:16, 8, 4, 13, 29, 11, 22. (CO1)
3-c. What will be the postfix expression for the infix expression A + B * (C + D) / F + D * E is 6
(CO2)
3-d. Write a Python code to find factorial of a number using recursion. (CO2) 6
3.f. Describe all Rotation in AVL tree. Construct AVL tree from the following nodes in given 6
order: B, C, G, E, F, D, A. (CO4)
SECTION C 50
Page 3 of 4
4. Answer any one of the following:-
4-a. What do you understand by divide and conquer algorithm? How this method is used in 10
merge sort? Write a program in Python to implement merge sort. (CO1)
4-b. What do you mean by Hashing Collision Resolution Technique (CRT)? Explain any three 10
CRTs with examples. (CO1)
5-a. Write a program which performs insertion and deletion as per user choice in a DE queue. 10
(CO2)
5-b. Write a menu driven program in python to implement the various operations on a linear 10
queue. (CO2)
6-a. What are doubly linked lists? Write a python program to create and display a doubly linked 10
list. (CO3)
6-b. Write short note on circular linked lists. Write a function to insert a node at front and rear 10
end in a circular linked list. Write down sequence of steps to be followed. (CO3)
7-a. Define tree, binary tree, complete binary tree and full binary tree. Write algorithms or 10
function to obtain traversals of a binary tree in preorder, post-order and in-order. (CO4)
7-b. What is a height balanced Tree? Why height balancing of Tree is required? Create an AVL 10
Tree for the following elements: a, z, b, y, c, x, d, w, e, v, f (CO4)
8-a. What is the diffrence between visiting a graph and traversing a graph? Explain any two 10
algorithm to find minimum cost spanning tree. (CO5)
8-b. Use Warshall's algorithm to find all pair shortest path for the given graph. (CO5) 10
Page 4 of 4