You are on page 1of 2

DATA STRUCTURES & ALGORITHMS

PART-A Answer ALL Questions (10x2=20 Marks)


1. What is an algorithm? List the desirable properties of an algorithm. CO1 K1
2. Compare and contrast iterative and recursive algorithms CO1 K1
3. Define Queue with an example. CO2 K1
4. Difference between Arrays and Linked List. CO2 K1
5. Transform the following expression to postfix (A+B-C)*(E/F)-(G-H/I) CO3 K2
6. What is the difference between AVL and splay tree CO3 K1
Write down the adjacency matrix representation of a graph with
7. CO4 K1
example.
8. Mention any two applications of greedy algorithm? CO4 K1
9. Sort the given number using shell sort 89,45,76,12,56,90,32,65,3. CO5 K2
10. What is the runtime complexity of Merge, Quick and Heap sort for best, CO5 K1
average and worst cases?

PART-B Answer ALL Questions (5x16=80 Marks)

11. Briefly explain the mathematical analysis of recursive and non- CO1 K3
(a) recursive algorithms. Give the recurrence relation for the factorial of
‘n’ numbers.
(or)
11. Define Big-O, Big-Ω and Big-ʘ Notation. Depict the same and explain CO1 K3
(b) with suitable example. Also prove that if g(n) is Ω(f(n)) then f(n) is
O(g(n)) .
12. Write routines for inserting and deleting elements from a Stack. Check CO2 K2
Font : Times New Roman
Size : 12 (a) for the conditions stack-empty and stack-full.
(or)
12. Give routines to inset and delete elements into a queue using linked CO2 K2
(b) list. Write function to insert into a circular queue with routines to
check for queue is full before inserting.
13. Construct an Expression tree for the following infix expression given CO3 K3
(a) as A+(B-C)*D+(E*F). Appropriately follow the procedures for
construction of an infix expression to postfix expression.
(or)
13. Define Balance Factor of AVL Tree. Insert the following keys into an CO3 K3
(b) empty AVL tree one by one 44, 30, 76, 16, 39, 37. Write the procedure
for single and double rotation.
14. With your own example describe in detail about an algorithm to find CO4 K3
(a) the minimum number of edges that need to be removed from an
undirected graph so that the resulting graph is acyclic.
(or)
14. What is single source shortest path problem? Discuss Dijikstra’s single CO4 K3
(b) source shortest path algorithm for the following graph with
intermediate stages.

15. For the elements 15, 2, 42, 4, 9, 72, 90, sort them using Insertion sort CO5 K3
(a) and Selection sort algorithms.
(or)
15 (b) What is hashing? What is the need for hashing? Given input {5371, CO5 K3
2323,7173,5199,5344, 8679,2989} and a hash function h(X) =(X mod
10), show the resulting:
(i) Separate Chaining table
(ii) Open addressing hash table using linear probing.
(iii) Open addressing hash table using quadratic probing.
(iv) Open addressing hash table with second hash function
h2(X)= 7 – (X mod 7)

You might also like