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. |

2k

0

Do you find this helpful?

1

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Recursive selection sort is a comparison based sort.
- What is the number of swaps required to sort the array arr={5,3,2,4,1} using recursive selection sort?
- Under what case of Master’s theorem will the recurrence relation of merge sort fall?
- Under what case of Master’s theorem will the recurrence relation of stooge sort fall?
- What will be the best case time complexity of recursive selection sort?
- What is the average case time complexity of recursive selection sort?
- How many recursive calls are there in Recursive matrix multiplication by Strassen’s Method?
- What is the advantage of iterative code for finding power of number over recursive code?
- Under what case of Master’s theorem will the recurrence relation of binary search fall?
- Which of the following sorting algorithms is used along with quick sort to sort the sub arrays?