code is working fine for custom input but getting TLEin one of testcase. while submitting
code ide:https://ide.codingblocks.com/s/126379
QUICKSORT is not submitting
@shakul
The average time complexity of quicksort is O(n log n) while its worst case complexity is still O(n^2). Ironically , the worst case for quicksort is when the entire array is already sorted. In such a case it takes n^2 time and hence you are getting a TLE. To resolve this issue , a modified version of quicksort called the Randomized Quicksort is used.
I suggest you to read about it.
Basically we just randomize the array to prevent the possibility of taking a sorted array and hence prevent its worst case scenario. Implement randomized quicksort and your code will pass.