Question: Problem 2 . [ Category: Analyzing Recursive Algorithms ] Consider the algorithm FunSort ( A [ 1 . . n ] ) if n >

Problem 2.[Category: Analyzing Recursive Algorithms] Consider the algorithm
FunSort(A[1..n])
if n >1 then
m n
2
for i 1 to m do
for j m +1 to n do
if A[j]< A[i] then
A[i] A[j]
end if
end for
end for
end if
FunSort(A[1..m])
FunSort(A[m +1..n])
1. Write a recurrence for this algorithms running time. (you do not need to argue for it.)[15 points]
2. Use the Master Theorem to solve the above recurrences, so as to express the running time in the form
(f (n)) or O(f (n)) where f should be as simple as possible. [5 points]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!