It's O(logn) but you haven't accounted for how heavy each item in the array of n is.
If you randomly index them and there's enough of them then on average the partitions average out.
This is true, but it probably isn't a box of books that's beeping.
I also feel like ordering the moves by lightest box first is reasonable as a real-world optimization.
Lol classic “ignore the constant factor” gotcha when using Big-O.
You can just move the lightest half of the boxes each time.