Assignments For MID 1 1738384079
Assignments For MID 1 1738384079
2. Sort the following list of elements using quick sort and derive the worst-case time complexity.
10,60,18,2,15,12,75,1,4,49
3. Solve the following instance of knapsack problem and compute optimal profit. M = 30
Weights= {10, 15, 8, 12,20}, profits = {20, 25, 15, 10,17},
4. Write an algorithm to find optimal merge pattern using Greedy method and analyze the time
complexity.
5. Discuss on general methodology of D ynamic programming and explain how it reduces no of
computations required with an example.
6. Present various asymptotic notations used to represent complexity of algorithms with examples?
Derive the average case time complexity of quicksort algorithm.
7. Find the shortest path distance between the source and destination vertices using greedy method?
8. Find Optimal Merge Pattern for a given set of 8 files and their records 40, 60, 15, 8, 20, 4, 8, 25
respectively.
9. Differentiate between greedy method and Dynamic programming.
10. Discuss various asymptotic notations used to represent complexity of algorithms with examples?
11. Write Divide and conquer algorithm for finding minimum and maximum value in a list and derive
its time complexity?
12. Differentiate between the Divide and conquer and Greedy method.
13. Find the no of record moves for the following instance of optimal storage on tapes problem. No
of files=14, no of tapes=3 and file lengths are 20, 3, 2, 7, 9, 13, 10, 5, 18, 12, 8, 6, 4, 11.
14. Find optimal solution of the following 0/1 knapsack problem using Dynamic Programming
method n=4, m=20, (p1, p2, p3, p4) = (10,18,20,15) and (w1, w2, w3, w4) = (3,15,12,10).