scandum / quadsort

Quadsort is a branchless stable adaptive mergesort faster than quicksort.
The Unlicense
2.13k stars 104 forks source link

Do you consider using C++'s template? #12

Closed Rratic closed 3 years ago

Rratic commented 3 years ago

Genericity in C++(template)is quite useful.

Making it more useful won't hurt.

scandum commented 3 years ago

There's someone working on a C++ port, but since quadsort is heavy on pointer usage it's not easy for the average person to port.

I do have a quadsort update ready for release that adds 8, 16, and 128 bit support.

Rratic commented 3 years ago

That's intersting! Maybe the algo can extend to octasort or even 2^n sort? For example,if it's 1024 bit ( (2^5)^2 ),we can try 2^5 sort? (Only thinking

scandum commented 3 years ago

The quad swap provides 100% optimal swapping at 4 items, so increasing this to 8 or 16 won't make this any more than 100%.