Nope. quicksort won’t. Not mergesort as well, if implemented properly. I used the sort function from the algorithm library which uses the quicksort algorithm for large n and nope, it didn’t give TLE. Dont worry it’ll work!
and anyway the time limit of this function in 5 sec. One can blindly vouch for merge sort or quicksort for this case.
Weak test cases probably. I’m sure you won’t get AC here with the above implementations
SPOJ.com - Problem TSORT
i have already done it on SPOj as well -- and FYI, i got an AC! It works --
Standard Sorting(C++) - 2.39 s
Merge Sort - 3.11 s
Heap Sort - 3.10 s
Count Sort - 2.33 s
Results posted by someone on comments of the same problem on SPOJ.
My bad
Anyway can I see your implementation of Standard sort which was AC on Spoj? What’s the point of solving the question then if you solve with any sorting algorithm (n log n).
Inbuilt Quick Sort in c can get you AC.
Heap sort is also working .
Counting sort is also one option with O(n).
Happy coding.
Its right that bubble sort uses too much time for execution.
BUT many have submitted using this sort technique successfully so whats the problem with my code.
Nobody would have used bubble sort, i am sure! If u feel that someone has used bubble sort and still submitted successfully, please comment a link of the solution! Bubble sort can never solve this problem. You atleast require an O(nlogn) technique.
bro! If you understood please do accept the answer so that we can close the question 
How do we accept an answer??
There will be a tick symbol down to the vote down symbol.
please view my quicksort code in the bottom…
what should i do??
is still giving TLE in quicksort.
this is the basic quick sort. I mean the naive one! Check for the case when the array is reversely sorted. The time complexity will be O(n^2). So use randomized quick sort. You can even use inbuilt sort function which is implemented using quick sort-sort(arr,arr+n) is the syntax of this inbuilt function. Include algorithm header file
@kaushik_iitd i implemented it using mergesort and it got AC. As i told -__- CodeChef: Practical coding for everyone
You can view above quicksort submitted by me…i dont think there is any slow i/o method and its still giving TLE.
Fine… let me check
Please accept an answer so that we can close this question.