Run error in quick sort

why does my code shows run error.
in previous other prob also it was showing the same

Maximum size of the array can be 200000.
In line 23, it should be quickSort(a,p+1,e); instead of quickSort(a,p,e);
In line 13, it should be swap(a[i],a[j]);
Updated Code -

Lines 26-28 generates a random number and swaps a[random] with a[e]. It is done just to avoid TLE.

i cant understand what you wrote in srand function. it is totally a new thing, saw for the first time.
pls provide a different approach for this.


i updated a few things except srand…now it is showing TLE for one of the test case…

Don’t pay attention to the srand thing. It is done just to avoid TLE in the coding blocks compiler.
Your code is correct. Don’t worry.

so will this code work in other compiler??

Yes it will work. You can try on other compilers.