Question: Consider the following function: function recsort ( A , i , j ) : if A [ i ] > A [ j ] :
Consider the following function:
function recsortAij: if AiAj: AiAj AjAi if ij: kintji recsortAijk recsortAikj recsortAijk
Which of the following is true for the function recsort? You may assume A is nonempty
Question Answer
a
This function always sorts the input array A in nlogn time regardless of the content of A
b
The worst case runtime for this function is nwhere n is the size of A
c
The worst case runtime for this function is nwhere n is the size of A
d
None of the above
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
