Hi Mike,

I tried your code. Looks good. But you know what, on my system here are the results that I got:

--------------------------------------------------------------
Ternary IntroSort vs. STL sort test app.
Comparing sorts using 5242880 integers.
--------------------------------------------------------------

Sorting with STL
Elapsed time to sort: 750.00 seconds
Sort verified.

Sorting with Ternary IntroSort
Elapsed time to sort: 870.00 seconds
Sort verified.

-------------------------------
All tasks completed.

[EMAIL PROTECTED] ~]$ ./a.out
--------------------------------------------------------------
Ternary IntroSort vs. STL sort test app.
Comparing sorts using 5242880 integers.
--------------------------------------------------------------

Sorting with STL
Elapsed time to sort: 760.00 seconds
Sort verified.


Sorting with Ternary IntroSort
Elapsed time to sort: 890.00 seconds
Sort verified.

-------------------------------
All tasks completed.

Your program was compiled using G++-4.0 with an -O3 optimization (includes inline functions, cross-jumping, function alignment, etc.) on a Linux machine. The results are as shown above. In all the executions, not one time did your sort out-perform STL's sort algorithm.  Can you explain?

sincerely,
mayur



On 2/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi Mike,
Your code is very interesting!

Have you tried the Anderson method?

"Sorting In Linear Time?" by A. Andersson, T. Hagerup, S. Nilsson, and
R. Raman (Proceedings of the 27th Annual ACM Symposium on the Theory of



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to