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
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
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.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
790
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
87%
Success Rate