Question Bank
Question Bank
6. Sort the following numbers using Quick sort, also derive complexity of quick
sort. 50,31,71,38,77,81,12,33
7. Sort the following numbers using merge sort also, derive the time
complexity of merge sort. 7,2,9,4,3,8,6,1.
8. Sort the following numbers using merge sort 7,6,1,4,8,3,2,9. 7. Find
Minimum and Maximum elements of an array
X[0:9]={45,83,75,17,43,37,80,53,61,22}using divide and conquer strategy.
9. Write algorithm for greedy knapsack and obtain the solution to following
Fractional greedy knapsack problem where n=5, m=100, (p1, p2....p5) =
(10,20,30,40,50) and (w1,w2,.....,w5) = (20,30,66,40,60).
10.Obtain the solution to the following knapsack problem using Greedy
method :n=7,m=15 (p1,p2 .........,p7) = (10,5,15,7,6,18,3) , (w1,w2,....., w7)=
(2,3,5,7,1,4,1) .
11.Find MST of following graph using prim’s and kruskal’s algorithm.
12.Find the shortest path from source vertex S using Dijkstra’s algorithm.
13.Find the Dijkstra’s shortest path from vertex 1 to vertex 4 for the following
graph.
Assi.Prof.Harshala Date