Re:Go will use pdqsort in next release
by benibela on Thursday April 21, 2022 @07:50AM
(#31108267)
I wanted a stable sort in one of my projects, so I implemented merge sort
Then I had a larger input (like 100k elements) and wondered, why does it take a few minutes to print the output, when it calculated the output in a second? Well, it was the merge sort being called after the calculation completed to print it sorted. A double fail, because the calculation already produced sorted output in this case.
Then I had a larger input (like 100k elements) and wondered, why does it take a few minutes to print the output, when it calculated the output in a second? Well, it was the merge sort being called after the calculation completed to print it sorted. A double fail, because the calculation already produced sorted output in this case.
Now I sort a list of indices with quick sort