2023 June CST306-C
2023 June CST306-C
1 Show that for any real constants a and b, where b > 0, (n + a) b = O(n b ) (3)
2 Solve the following recurrence equations using Master theorem.
a. T(n) = 3T(n/2) + n2 (3)
b. T(n) = 2T(n/2) + n log n
3 Define AVL tree. Explain the rotations performed for insertion in AVL tree. (3)
4 Find the different topological ordering of the given graph. (3)
Page 1of 3
1200CST306052303
Module III
15 a) Explain 2- way merge sort algorithm with an example and derive its time (7)
complexity.
b) Find the optimal solution for the following Fractional Knapsack problem. (7)
Given the number of items(n) = 7, capacity of sack(m) = 15,
W={1, 3, 5, 4, 1, 3, 2} and P = {10, 15, 7, 8, 9, 4}
OR
16 a) Apply Kruskal’s algorithm for finding minimum cost spanning tree. (7)
Page 2of 3
1200CST306052303
b) Apply Dijikstra’s algorithm for finding the shortest path from vertex A to all (7)
other vertices.
Module IV
17 a) Find the optimal parenthesis of matrix chain product whose sequence of (8)
dimensions is 5 x 4, 4 x 6, 6 x 2, 2 x 7
b) Explain 4 queen problem. Draw the state space tree for 4 queen problem. (6)
OR
18 a) Define TSP problem. Apply branch and bound algorithm for solving TSP. (9)
b) Write Floyd Warshall’s algorithm for finding all pairs shortest path algorithm. (5)
Module V
19 a) Explain the first fit-decreasing strategy of bin packing algorithm. (7)
b) Prove that Clique Decision problem is NP-complete. (7)
OR
20 a) Differentiate Las Vegas and Monte Carlo algorithms (7)
b) Explain randomized quick sort with the help of suitable examples. (7)
****
Page 3of 3