Bitonic Sort

Bitonic Sort is an $$O(n \log^2 n)$$ sort. it can be implemented as a sorting network, meaning it is unstable, not adaptive, and uses $$O(1)$$ memory.

= Explanation = I have no idea how it works lol

= Pseudocode = procedure bitonic_sort(array arr) do for k = 2, k <= length(arr), k *= 2 do for j = k / 2, j > 0, j /= 2 do for i = 0 to length(arr) - 1 do int l = i bitwiseXor j            if ((i bitwiseAnd k) == 0 and arr[l] < arr[i]) or ((i bitwiseAnd k) != 0) and arr[i] < arr[l])) do swap arr[i] and arr[l] end if end for end for end for end