baserinia / parallel-sort

An efficient C++ multi-threaded sorting function based on C++11 threads
GNU General Public License v3.0
27 stars 7 forks source link

What algorithm is used in your code? #1

Open kimlongli opened 6 years ago

kimlongli commented 6 years ago

I just wonder what algorithm is used in your code. The code related to mapping is difficult for me to understand. Thank you!

baserinia commented 6 years ago

It uses quick sort! Basically, it splits a vector into a few sub-vectors, then each sub-vector is sorted sequentially using std::sort in a separate thread. Finally the results are merged. The function std::sort in C++ is implemented based on the quick sort algorithm

a2468834 commented 3 years ago

Hello~ I' wondering that what does the parameter sf (sampling factor) use for? I have known quick sort and introsort (used by std::sort()) But it seems that they does not have the parameter sampling factor.