admin管理员组文章数量:1321045
I've been trying to implement timsort with the powersort merging strategy. The problem I'm having is that I can't figure out how the conditions required by merge_hi and merge_lo is upheld even when looking at the code. merge_lo and _hi states that:
... Must also have that ssa.keys[na-1] belongs at the end of the merge, ...
and if you look at the official java implementation which seems even more restrictive, it states:
The first element of the first run must be greater than the first element of the second run (a[base1] > a[base2]), and the last element of the first run (a[base1 + len1-1]) must be greater than all elements of the second run.
The java implementation does not use powersort though.
Any one with some experience with these algorithm that can give some insight?
本文标签: algorithmtimsort with powersort merging strategyStack Overflow
版权声明:本文标题:algorithm - timsort with powersort merging strategy - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742093165a2420387.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论