it only works if the number of items is a power of 2 diagram stolen from https://xilinx.github.io/Vitis_Libraries/database/2021.1/guide/sort/bitonic_sort.html