Mike and HashTrick one testcase 6 showing timelimit


is my code all test cases are successful but only
one test case 6 is showing time limit plz…kindly
rectify my error.

Hi @akansha2603,your sort function is taking time so try to reduce its complexity.

Hi can u suggest how can i reduce complexity of

my sorting algoritm. i am using quick sort??

Hi can u suggest how can i reduce complexity of my sorting algoritm. i am using quick sort??

In quick sort we basically find the pivot index and divide the array from the pivot one from startindex to pivot index-1 and another from pivotindex+1 to endindex and then apply quick sort on those two arrays.In your code the complexity is becoming n^2 as you have used loop inside the loop.Try to correct your quicksort algorithm.