Assignment 1 Daa
Assignment 1 Daa
5. Sort the following sequence {23, 11, 5, 15, 68, 31, 4, 17} using merge sort algorithm.
6. Sort the following sequence {20, 10, 40, 30, 60, 15} using quick sort algorithm.
Where last element as pivot.
7. Write Master’s theorem and explain it with the help of suitable example.
10. What do you understand by stable and unstable sorting? Sort the following
sequence {25, 57, 48, 36, 12, 91, 86, 32} using heap sort.
11. Solve the following recurrence relation using recursive tree method:
(i)T (n) = T (n/5) + T (3n/5) + n (ii) T (n) = T (n/10) + T (9n/10)+ n
12. Write the algorithm of shell sort and derive its complexity.