showing wrong output in my code
Wrong output in my code
I have modified your code a bit. Try to submit it now.
not a single test case is passed while submitting
You are required to use a random function as well in your code, Since the question says that you have to do randomised quick sort. You can refer the online video lecture on randomised quick sort, since quick sort gives worst complexity when array elements are in reverse order. Try to modify using that only.
but i have used random function in my original code
void shuffle(long long int ar[1000000],long long int start,long long int end)
{
long long int i,j;
srand(time(NULL));
for(long long int i=end;i>0;iā)
{
j=rand()%(i+1);
swap(ar[i],ar[j]);
}
}
Add this function in your code, and then try to submit.
but i am not able to understand this function
Plz refer to the video lecture : Randomised quickdsort given in online lectures of Recursion for clear understanding.