tony2001/sort — comment on commit bbf7d63cc313f6b7ea9d0b8206a8edacf820e379
File:  line 0
By swenson:

I meant code-wise, the algorithm is very similar to the unbalanced, in-place merge that is the heart of timsort. But anyways, I think it's fine to add more code.

For the CLZ question, this is what you want:

int k = 1LL << (63 - CLZ(k));

As soon as that is done, and we hear back on the licensing issue, it sounds great to me.

Thanks for the graphic, that is very helpful. Timsort should also be more more of a win as the comparison gets more expensive, i.e., you are sorting lists of pointers, or lists of pointers to pointers.