Aoa QB
Aoa QB
3 What are asymptotic notations? Define Big O, Ω and theta with the help of examples and 1 2
graphical notation
4 Explain Recurrence with example. 1 2
10 Compare Greedy and Divide and Conquer approaches for algorithm design. 2 2
12 Explain how divide and conquer is used in Binary Search with example 2 2
13 Sort the list using merge sort algorithm and show its computing time is O(nlogn) : 2 2
10,5,7,6,1,4,8,3,2,9.
14 Write an algorithm for finding minimum and maximum using divide and conquer. Also, derive 2 2
its complexity.
15 Differentiate between Prims and Kruskals algorithm. 3 2
10 1 25
6
14 2
15 7
24 16
5
18 3
22 4 12
22 Find the Minimum spanning trees of the following graph using Kruskal’s Algorithm. 3 5
10 1 25
6
14 2
15 7
24 16
5
18 3
22 4 12
23 Solve the following instance of job sequencing with deadlines problem n=7, 3 5
profits(p1,p2,p3,p4,p5,p6,p7)=(3,5,20,18,1,6,30) and deadlines
(d1,d2,d3,d4,d5,d6,d7)=(1,3,4,3,2,1,2). Schedule the jobs in such a way so as to get maximum
profit.
24 Sort the numbers using Quick Sort. Also, derive the time complexity of Quck Sort Sort. 2 5
50, 31, 71, 38, 77, 81, 12, 33
25 Explain Quick sort with algorithm and example 2 5
26 Consider the instance of knapsack problem where n=6, M=15, profits are 3 5
(P1,P2,P3,P4,P5,P6)=(1,2,4,4,7,2) and weights are (w1,w2,w3,w4,w5,w6)=(10,5,4,2,7,3).
Find maximum profits using fractional knapsack.
27 Write and explain the greedy knapsack and obtain the solution to following knapsack problem 3 5
where n=7, m=15, (p1,p2,…,p7)=(10,5,15,7,6,18,3), (w1,w2,….,w7)(2,3,5,7,1,4,1)
6
b e
1 5 4
4
a d 3 f h
2 2
3 1
c 4 g
0
3
6
1
1 3
5
5
3 4 2
6 4
2 5
6
30 Find shortest path from vertex 1 to vertex 4 using Dijkstra’s algorithm for the following graph. 3 5
4
2 3
7 8
5
1 2 5 4
3 6 3
6 5