2. Consider a recursive version of insertion sort that goes like this: To sort a list of size n, sort the last n 1 elements recursively, then deal with the first element. - (a) Write down the algorithm. (b) Write down the recurrence relation for the running time of your algorithm. (c) Solve the recurrence relation with full details and thus give the running time of your algorithm in notation.
2. Consider a recursive version of insertion sort that goes like this: To sort a list of size n, sort the last n 1 elements recursively, then deal with the first element. - (a) Write down the algorithm. (b) Write down the recurrence relation for the running time of your algorithm. (c) Solve the recurrence relation with full details and thus give the running time of your algorithm in notation.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps