[algogeeks] Re: Can anyone point out the mistakes in my program?

2006-06-26 Thread Nishu
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

[algogeeks] Re: Can anyone point out the mistakes in my program?

2006-06-26 Thread Thomas.Chang
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++

[algogeeks] Re: Can anyone point out the mistakes in my program?

2006-06-25 Thread adak
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,

[algogeeks] Re: Can anyone point out the mistakes in my program?

2006-06-25 Thread Thomas.Chang
Thanks, but it seems not a problem. if(ihttp://groups.google.com/group/algogeeks -~--~~~~--~~--~--~---

[algogeeks] Re: Can anyone point out the mistakes in my program?

2006-06-25 Thread Nat (Padmanabhan Natarajan)
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