What is the mistake?
Your code is not working in case of worst case as, For eg, when ur array is completely reversed…
Then The complexity of quicksort will be O(n^2)… So to consider that test case… You need to create a shuffle function… so that you get a random array and then u can simply apply quicksort function to the newly random array obtained…
void shuffle(ll *a,ll s,ll e)
{
ll j;
srand(time(NULL));
for(ll i=e;i>0;i–)
{
j=rand()%(i+1);
swap(a[i],a[j]);
}
}