Don’t listen to the haters but it would have been nice if you collapsed this because it is very long and generalized to the point that it is pretty much an eyesore. Plus most people can ask their AI of choosing semi-random topics. I don’t see what was interesting in the AI response at all. It states some blatantly obvious facts and is rather too wordy. I intentionally include into the system prompt or “personalization” about how I like things to be kept short and to not reiterate what I had posted especially if it just sounds like the “AI” is thinking out loud.
Glibc’s qsort will default to either insertion sort mergesort or heapsort. Quicksort itself is used when it cannot allocate extra memory for mergesort or heapsort. Insertion sort is still used in the quicksort code, when there is a final 4 items that need to be sorted.
Normally it is simply mergesort or heapsort. Why I know this? Because there was a recent CVE for quicksort and to reproduce the bug I had to force memory to be unable to be allocated with a max size item. It was interesting reading the source code.
That is if you are not on a recent version of qsort which simply removed quicksort altogether for the mergesort + heapsort
Older version still had quicksort and even some had insertion sort. Its interesting to look at all the different versions of qsort.