Thomas.Chang wrote:
> Thanks for you reply.
> Yes, I can use the qsort() in standard c library to finish my work. But
> what I want to know is why I was wrong. Qsort is a great, because it
> shortens the sorting time from O(n^2) to O(nlogn). But I want to know
> if I am thinking the wrong way aga
Thanks for you reply.
Yes, I can use the qsort() in standard c library to finish my work. But
what I want to know is why I was wrong. Qsort is a great, because it
shortens the sorting time from O(n^2) to O(nlogn). But I want to know
if I am thinking the wrong way against the discoverer's.
The "i++
Thomas.Chang wrote:
> Following is a qsort() program, I checked it carefully severally times
> and tested with a lot of cases without finding any error. But when I
> submit the program using it to online judge, it always "wrong answer",
> if I substitute it with the standard qsort() of c library,
Thanks, but it seems not a problem.
if(ihttp://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---
I did not get to read the program completely or run it or test it, but my surmise is you are not incrementing left pointer and decrementing right pointer after swapping as I have indicated below.
On 6/25/06, Thomas.Chang <[EMAIL PROTECTED]> wrote:
Following is a qsort() program, I checked it carefu