Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Funny way how NOT to speedup sorting of small arrays
Re: Funny way how NOT to speedup sorting of small arrays [message #19917 is a reply to message #19916] Sun, 01 February 2009 23:06 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
mr_ped wrote on Sun, 01 February 2009 14:13

I think with 10+ elements already quicksort can pay off.



In U++, we maintain 16 as threshold.

Quote:


A well implemented quicksort will not hurt even with 2-3 elements that much.



There is only so much you can do with plain quicksort. All real quicksort algorithms switch to selection sort or insert sort when subsequence goes under certain threshold. It makes it quite faster.

Thus, if I could invent some faster variant for up to 16 elements, we would have a huge win...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 1538 compilation fails
Next Topic: German language added to Docking.t of bazar/Docking
Goto Forum:
  


Current Time: Sun Apr 27 22:13:41 CEST 2025

Total time taken to generate the page: 0.00495 seconds