Aphitorite's Method

aphitorite's Method is an extremely complex and as of unfinished sorting algorithm that achieves $$O(n \log n)$$ worst case comparisons, $$O(n)$$ moves, and $$O(1)$$ space while also being Stable and Deterministic (meaning no randomness). It is a variant of Franceschini's method.

= Explanation =

Bit Buffer:
A bit buffer is 2 equal ranges of elements that can encode a sequence of bits based on the relative values of the elements in them.

For every element in the first range (call this B), there is one corresponding element in the second range (call this B') and vice versa, as the ranges are the same length.

An element in B cannot be equal to its corresponding element in B'. if it is less, that pair encodes a binary 0. if greater, it encodes a binary 1.

Bit buffers cost $$O(1)$$ operations to set or flip a bit, and $$O(n)$$ (where n is the size of the buffer) to read the contents.