Here is the code: https://ide.codingblocks.com/s/202637
It is giving time limit exceeded in a test case . Can you tell me what is the error
QuickSort(T.L.E.)
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.
ok will check it out thanks.