Question: Unusual(A[1 .. n]): if n = 2 //the only comparison! if A[1] > A[2] swap a[1] with A[2] else for i from 1 to n/4

 Unusual(A[1 .. n]): if n = 2 //the only comparison! if

Unusual(A[1 .. n]): if n = 2 //the only comparison! if A[1] > A[2] swap a[1] with A[2] else for i from 1 to n/4 l/swap 2nd and 3rd quarters //recurse on left half swap A[i + n/4] with A[i+ n/2] Unusual(A[1, .. ,n/2]) Unusual(A[n/2 + 1, .. ,n]) Unusual(A[n/4 + 1, .. ,3n/4]) T/recurse on right half //recurse on middle half What is a recurrence relation that describes the Unusual portion of the algorithm? T(n) = 3T(n/2) +cn/4 T(n) = T(n/4) + cn/2 T(n) = 3T(n) + n T(n) = 4T(n/2) + n/4 none of the above

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 Databases Questions!