DSA w22
DSA w22
P. Pages : 2 GUG/W/22/13802
Time : Three Hours *3031*
Max. Marks : 80
_____________________________________________________________________
Notes : 1. All questions carry equal marks.
2. Assume suitable data wherever necessary.
3. Illustrate your answers wherever necessary with the help of neat sketches.
b) Write a function for linear search and binary search. Also explain its worst case and best 8
case time complexity?
OR
2. a) Define time and space complexity of algorithm? Explain different asymptotic notations 8
used for analysis of algorithm.
b) Explain circular linked list and doubly linked list with neat sketch. 8
OR
4. a) What is linked list? Explain various types of linked list with neat sketch. 8
OR
6. a) Write short note on priority queue? 4
GUG/W/22/13802 1 P.T.O
7. a) Define Binary trees. Write a C – function for preorder, postorder, inorder tree traversals. 8
Also write the preorder, postorder, inorder expression for the following binary tree.
A
B C
D
E F
G
b) Write short note on AVL trees. Explain single rotation and double rotation in AVL trees. 8
OR
8. a) What is binary search tree? Write a function for insert, delete and search operation in 8
BST?
b) Sort the following array using bubble sort, slowing all the iterations – 11, 15, 2, 13, 6, 8 8
Also write function for bubble sort.
OR
10. a) Explain Prim’s and Kruskal’s spanning tree algorithms with example? 8
************
GUG/W/22/13802 2