Closed TS60 closed 7 months ago
It's technically n log(n)²
moves, but the number of moves is reduced by a large constant.. so I've left it kind of vague, as blitsort is still faster than alternative algorithms that are technically n log(n)
moves, but introduce a large k.
Thanks for the quick answer!
Hi, I wanted to ask about the complexity of the number of swaps/moves/assignments that come from the merging algorithm. The table only gives the complexity of the comparisons and extra memory used.
The description about the merging algorithm let it sound similiar to Symmerge and Recmerge:
It probably recursively halves the size and rotates. I assume, the number of swaps/moves/assignments is
O(m*Log2(m+n))
for two sorted sequences of sizesm
andn
, wherem <= n
. This would then result in a total complexity for blitsort ofO(N*Log2(N))
comparisons andO(N*Log2(N)*Log2(N))
swaps/moves, if my assumption is correct. This would also be in line with the observation:To sum up my question: Has blitsort a total worst-case complexity of
O(N*Log2(N))
orO(N*Log2(N)*Log2(N))
?