McqMate
| 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. | |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet