Data Structures & Algorithms PART-A Answer ALL Questions (10x2 20 Marks)
Data Structures & Algorithms PART-A Answer ALL Questions (10x2 20 Marks)
Data Structures & Algorithms PART-A Answer ALL Questions (10x2 20 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)