Q.

What will be the recurrence relation of the code of recursive selection sort?

A. t(n) = 2t(n/2) + n
B. t(n) = 2t(n/2) + c
C. t(n) = t(n-1) + n
D. t(n) = t(n-1) + c
Answer» C. t(n) = t(n-1) + n
Explanation: function to find the minimum element index takes n time.the recursive call is made to one less element than in the previous call so the overall recurrence relation becomes t(n) = t(n-1) + n.
2k
0
Do you find this helpful?
6

Discussion

No comments yet