Question: 5. Compute Complexity from formula of T(n). (a) T(n) = T(n/2) + n (b) T(n) 4T(n/2) + n2VIn) (c) T(n) T(n -1)Ign (d) T(n) T(VIn))+
5. Compute Complexity from formula of T(n). (a) T(n) = T(n/2) + n (b) T(n) 4T(n/2) + n2VIn) (c) T(n) T(n -1)Ign (d) T(n) T(VIn))+ n2 6. Problems on Sorting (a) If all the clements in an array are sor ted in the decrcasing order and we want them in increasing order, which sorting algorithm will be asymptotically the fastest; insertion sort, quick sort, merge sort (b) If all the elements in an array are sorted in the incrcasing order and we want them in incrcasing order, which sorting algorithm will be asymptotically the fastest; inscrtion sort, quick sort, merge sort (c) Prove that the optimal complexity for a comparison bascd sort is O(nlogn) (d) Given that the range of the numbers is from 0 to n2, which sorting algorithm will be asymptotically the fastest; counting sort, quick sort (c) Supposc instcad of sorting we require an array to be k - sorted, that is for all i - 1,2,,3... n - k the following condition holds
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
