DAA Question Bank Unit 1
DAA Question Bank Unit 1
Long Questions
1. What is heap sort? Apply heap sort algorithm for sorting '1,2,3, 4, 5, 6,7, 8, 9., 10. Also
deduce time complexity of heap sort. [2015-16 (5-marks)]
2. Explain the concepts of quick sort method and analyse its complexity with suitable example.
[2016-17 (5-marks)]
3. Explain the concept of merge sort with example. [2016-17 (5-marks)]
4. Solve the recurrence: T (n) = 50 T (n/49) + log n! [2018-19 (10-marks)]
Prepared by:
Mr. Rohit Mishra
5. Illustrate the operation of Quick sort on the array, A= (9, 14, 87, 4, 32, 86, 67) [2018-19 (-
marks)]
6. Solve the recurrence using recursion tree method: T (n) = T (n/2) + T (n/4) + T (n/8) + n
[2018-19 (2-marks)]
7. Use a recursion tree to give an asymptotically tight solution to the recurrence T(n) = T(αn) +
T((1 -α)n) + cn, where α is a constant in the range 0 <α< 1 and c> 0 is also a constant. [2018-
19 (7-marks)]
8. The recurrence T (n) = 7T (n/3) + n2 describes the running time of an algorithm A. Another
competing algorithm B has a running time of S (n) = a S (n/ 9) + n2. What is the smallest
value of ‘a’ such that A is asymptotically faster than B.? [2018-19 (7-marks)]
9. How will you sort following array A of elements using heap sort: A = (23, 9, 18, 45, 5, 9, 1,
17, 6). [2018-19 (7-marks)]
10. Solve the recurrence T (n) = 2T(n/2) + n2+ 2n+ 1 [2019-20 (7-marks)]
11. Prove that worst case running time of any comparison sort is Ω(nlogn) [2019-20 (7-marks)]
12. Among Merge sort, Insertion sort and quick sort which sorting technique is the best in worst
case. [2019-20 (7-marks)]
13. Apply the best one among these algorithms to Sort the list E, X, A, M, P, L, E in alphabetic
order. [2019-20 (7-marks)]
14. Solve the recurrence using recursion tree method: T (n) = T (n/2) + T (n/4) + T (n/8) + n
[2019-20 (7-marks)]
15. Write an algorithm for counting sort. Illustrate the operation of counting sort on the following
array: A={4,0,2,0,1,3,5,4,1,3,2,3}[2020-21 (10-marks)]
16. Solve the following recurrence relation: [2020-21 (10-marks)]
a. T(n) =T(n-1) + n4
b. T(n) =T(n/4) + T(n/2) + n2
17. Write an algorithm for insertion sort. Find the time complexity of insertion sort in all cases.
[2020-21 (10-marks)]
18. Explain Merge sort algorithm and sort the following sequence {23, 11, 5, 15, 68,31, 4,
17} using merge sort. [2022-23 (10-marks)]
19. Examine the following recurrence relation: [2022-23 (10-marks)]
(i) T (n) = T (n-1) + n 4
(ii) T (n) = T (n/4) + T (n/2) + n 2
20. Explain algorithm for counting sort. Illustrate the operation of counting sort on the
following array: A={0,1,3,0,3,2,4,5,2,4,6,2,2,3}. [2022-23 (10-marks)]
Prepared by:
Mr. Rohit Mishra